Skip to content

Commit ba7b39e

Browse files
Updated docs for Minimum Set Cover
1 parent 8f4a608 commit ba7b39e

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

docs/minimum-set-cover.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
::: flowpaths.minsetcover
2+
options:
3+
filters:
4+
- "!^__"

flowpaths/minsetcover.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ def __init__(
1010
):
1111
"""
1212
This class solves the minimum set cover problem. Given a universe `universe` and a list of subsets `subsets`,
13-
the goal is to find the smallest list of subsets `set_cover` such that:
13+
the goal is to find the minimum-weight list of subsets `set_cover` such that:
1414
1515
- every element in `universe` is in at least one subset in `set_cover`.
1616
- the sum of the weights of the subsets in `set_cover` is minimized.
1717
1818
Parameters
1919
----------
2020
21-
- `universe` : list`
21+
- `universe: list`
2222
2323
The universe of elements that must be covered.
2424
25-
- `subsets : list`
25+
- `subsets: list`
2626
2727
A list of subsets that can be used to cover the universe.
2828
29-
- `subset_weights : list`
29+
- `subset_weights: list`
3030
3131
The weight of each subset, as a list in the same order that the subsets appear in the list `subsets`.
3232
If not provided, each subset is assumed to have a weight of 1.
@@ -129,6 +129,12 @@ def check_is_solved(self):
129129
def get_solution(self, as_subsets: bool = False):
130130
"""
131131
Returns the solution to the minimum generating set problem, if the model was solved.
132+
133+
Parameters
134+
----------
135+
- `as_subsets: bool`
136+
137+
If `True`, returns the subsets themselves. If `False`, returns the indices of the subsets in the list `subsets`.
132138
133139
!!! warning "Warning"
134140
Call the `solve` method first.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ nav:
2323
- Solver Wrapper: solver-wrapper.md
2424
- stDiGraph: stdigraph.md
2525
- Minimum Generating Set: minimum-generating-set.md
26+
- Minimum Set Cover: minimum-set-cover.md
2627

2728
use_directory_urls: false
2829

0 commit comments

Comments
 (0)