ecj#

cloneBfree#

gunfolds.utils.ecj.cloneBfree(G)[source]#
Parameters:

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

Returns:

Return type:

dfs_topsort#

gunfolds.utils.ecj.dfs_topsort(G)[source]#
Parameters:

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

Returns:

Return type:

gcd#

gunfolds.utils.ecj.gcd(a, b)[source]#

Returns greatest common divisor of a and b

Parameters:
  • a (integer) – first value

  • b (integer) – second value

Returns:

greatest common divisor of a and b

Return type:

integer

has_unit_cycle#

gunfolds.utils.ecj.has_unit_cycle(G, path)[source]#

Checks if two unequal length paths can be compensated by their elementary cycles

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

  • path

Returns:

True, if two unequal length paths can be compensated by their elementary cycles and vice versa

Return type:

boolean

listgcd#

gunfolds.utils.ecj.listgcd(l)[source]#

Returns greatest common divisor for a given list of numbers

Parameters:

l (list) – list of values

Returns:

greatest common divisor for a given list of numbers

Return type:

integer

listgcd_r#

gunfolds.utils.ecj.listgcd_r(l)[source]#

Returns greatest common divisor for a given list of numbers using recursion

Parameters:

l (list) – list of values

Returns:

greatest common divisor for a given list of numbers

Return type:

integer

reachable#

gunfolds.utils.ecj.reachable(s, G, g)[source]#
Parameters:
  • s

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

  • g ((guess)dictionary (gunfolds graphs)) – (guess)``gunfolds`` graph

Returns:

Return type:

boolean

scc#

gunfolds.utils.ecj.scc(G)[source]#

Returns a list of strongly connected components using Kosaraju’s algorithm

Parameters:

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

Returns:

a list of strongly connected components using Kosaraju’s algorithm

Return type:

list

tr#

gunfolds.utils.ecj.tr(G)[source]#

Reverses all the edges in the graph

Parameters:

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

Returns:

transposed graph

Return type:

dictionary (gunfolds graphs)

walk#

gunfolds.utils.ecj.walk(G, s, S={})[source]#
Parameters:
  • G (dictionary (gunfolds graphs)) – gunfolds format graph

  • s

  • S

Returns:

Return type: