comparison#

compatible_at_u#

gunfolds.utils.comparison.compatible_at_u(uGstar)[source]#
Parameters:

uGstar

Returns:

Return type:

gcd4scc#

gunfolds.utils.comparison.gcd4scc(SCC)[source]#

Returns the greatest common divisor of simple loop lengths and in one SCC

Parameters:

SCC (dictionary (gunfolds graphs)) – gunfolds graph

Returns:

the greatest common divisor of simple loop lengths and in one SCC

Return type:

integer

has_root#

gunfolds.utils.comparison.has_root(G)[source]#
Parameters:

G (dictionary (gunfolds graphs)) – gunfolds format graph

Returns:

Return type:

has_self_loops#

gunfolds.utils.comparison.has_self_loops(G)[source]#

Checks if a graph has self loop and vise versa

Parameters:

G (dictionary (gunfolds graphs)) – gunfolds format graph

Returns:

True, if the graph has self loop and vise versa

Return type:

boolean

has_sink#

gunfolds.utils.comparison.has_sink(G)[source]#
Parameters:

G (dictionary (gunfolds graphs)) – gunfolds format graph

Returns:

Return type:

randSCC#

gunfolds.utils.comparison.randSCC(n)[source]#

Returns a random gunfolds graph with gcd>1

Parameters:

n (integer) – number of nodes

Returns:

random gunfolds graph with gcd>1

Return type:

dictionary (gunfolds graphs)

search_match#

gunfolds.utils.comparison.search_match(Gstar, G, iter=5)[source]#
Parameters:
  • Gstar

  • G (dictionary (gunfolds graphs)) – gunfolds format graph

  • iter (integer) –

Returns:

Return type:

SM_converging#

gunfolds.utils.comparison.SM_converging(Gstar, G)[source]#

Gstar is the undersampled reference graph, while G is the starting graph. The code searches over all undersampled version of G to find all matches with Gstar

Parameters:
  • Gstar

  • G (dictionary (gunfolds graphs)) – gunfolds format graph

Returns:

Return type:

SM_fixed#

gunfolds.utils.comparison.SM_fixed(Gstar, G, iter=5)[source]#

(Ask)

Parameters:
  • Gstar

  • G (dictionary (gunfolds graphs)) – gunfolds format graph

  • iter (integer) –

Returns:

Return type: