neighborhoods#

find_nearest_reachable#

gunfolds.utils.neighborhoods.find_nearest_reachable(g2, maxsolutions=100, max_depth=5, timeout=3600, cpath='', verbose=True)[source]#
Parameters:
  • g2

  • maxsolutions

  • max_depth

  • timeout

  • cpath

  • verbose

Returns:

Return type:

hamming_neighbors#

gunfolds.utils.neighborhoods.hamming_neighbors(v, step)[source]#

Returns an iterator over all neighbors of the binary vector v Hamming step away from it

Parameters:
  • v – a binary vector representing a G^u graph

  • step – Hamming distance from v of the vectors to generate

Returns:

Return type:

ncr#

gunfolds.utils.neighborhoods.ncr(n, r)[source]#
Parameters:
  • n

  • r

Returns:

Return type:

num_nATstep#

gunfolds.utils.neighborhoods.num_nATstep(g, step)[source]#
Parameters:
  • g (dictionary (gunfolds graphs)) – gunfolds graph

  • step – (GUESS)Hamming distance from v of the vectors to generate

Returns:

Return type:

num_neighbors#

gunfolds.utils.neighborhoods.num_neighbors(g, step)[source]#
Parameters:
  • g (dictionary (gunfolds graphs)) – gunfolds graph

  • step – (GUESS)Hamming distance from v of the vectors to generate

Returns:

Return type: