Skip to content

Commit

Permalink
Add some info about this function to the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwg4 committed Nov 30, 2023
1 parent 134ddfc commit 81a908f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Now we can call `exact_cover`:
This is telling us that the 0th row (i.e. A), the 2nd row (i.e. C),
and the 3rd row (i.e. D) together form an exact cover.

To see the total number of distinct solutions, we can use the function get_solution_count:

>>> ec.get_solution_count(S)
1

See the file examples.md for more detailed examples of use.


Expand Down
5 changes: 5 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ The numpy type to use is defined in the package for convenience and compatibilit
>>> T = np.array([[1,0,0,1,0],[1,1,1,0,0],[0,1,1,0,0],[0,0,0,0,1]], dtype=DTYPE_FOR_ARRAY)
>>> print(ec.get_exact_cover(T))
[0 2 3]

It's also possible to retrieve the total number of solutions to an exact cover problem:
>>> ec.get_solution_count(T)
1

0 comments on commit 81a908f

Please sign in to comment.