Package sage :: Package combinat :: Package matrices :: Module dancing_links
[hide private]
[frames] | no frames]

Module dancing_links



File: sage/combinat/matrices/dancing_links.pyx (starting at line 1)

Dancing Links internal pyx code



Classes [hide private]
  dancing_linksWrapper
Functions [hide private]
 
dlx_solver(...)
File: sage/combinat/matrices/dancing_links.pyx (starting at line 245) Internal-use wrapper for the dancing links C++ code.
 
make_dlxwrapper(...)
File: sage/combinat/matrices/dancing_links.pyx (starting at line 276) Create a dlx wrapper from a Python *string* s.
Function Details [hide private]

dlx_solver(...)

 
File: sage/combinat/matrices/dancing_links.pyx (starting at line 245)

Internal-use wrapper for the dancing links C++ code.

EXAMPLES:
    sage: from sage.combinat.matrices.dancing_links import dlx_solver
    sage: rows = [[0,1,2]]
    sage: rows+= [[0,2]]
    sage: rows+= [[1]]
    sage: rows+= [[3]]
    sage: x = dlx_solver(rows)
    sage: print x.search()
    1
    sage: print x.get_solution()
    [3, 0]
    sage: print x.search()
    1
    sage: print x.get_solution()
    [3, 1, 2]
    sage: print x.search()
    0

make_dlxwrapper(...)

 
File: sage/combinat/matrices/dancing_links.pyx (starting at line 276)

Create a dlx wrapper from a Python *string* s.
This is used in unpickling. We expect s to be dumps(rows) where
rows is the list of rows used to instantiate the object.

TESTS:
    sage: rows = [[0,1,2]]
    sage: x = make_dlxwrapper(dumps(rows))
    sage: print x.__str__()
    [[0, 1, 2]]