Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting max-flow problem in MILP tutorial #38557

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/doc/en/thematic_tutorials/linear_programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ just as much as they receive. We can model the flow problem with the
following LP

.. MATH::
\text{Max: } & \sum_{sv \in G} f_{sv}\\
\text{Max: } & \sum_{su \in G} f_{su} - \sum_{vs \in G} f_{vs}\\
\text{Such that: } & \forall v \in G, {\substack{v \neq s \\ v \neq t}}, \sum_{vu \in G} f_{vu} - \sum_{uv \in G} f_{uv} = 0\\
& \forall uv \in G, f_{uv} \leq 1\\

Expand Down Expand Up @@ -425,7 +425,7 @@ graph, in which all the edges have a capacity of 1::

::

sage: p.set_objective(p.sum(f[s,u] for u in g.neighbors_out(s)))
sage: p.set_objective(p.sum(f[s,u] for u in g.neighbors_out(s)) - p.sum(f[v,s] for v in g.neighbors_in(s)))

.. link

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@

Sage example in ./lp.tex, line 684::

sage: p.set_objective(p.sum( f[s,u] for u in g.neighbors_out(s)))
sage: p.set_objective(p.sum( f[s,u] for u in g.neighbors_out(s)) - p.sum(f[v,s] for v in g.neighbors_in(s)))

Sage example in ./lp.tex, line 687::

sage: p.solve()

Check failure on line 194 in src/sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 714, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1144, in compile_and_execute exec(compiled, globs) File "<doctest sage.tests.books.computational-mathematics-with-sagemath.lp_doctest[58]>", line 1, in <module> p.solve() File "sage/numerical/mip.pyx", line 2638, in sage.numerical.mip.MixedIntegerLinearProgram.solve self._backend.solve() File "sage/numerical/backends/glpk_backend.pyx", line 1142, in sage.numerical.backends.glpk_backend.GLPKBackend.solve raise MIPSolverException("GLPK: "+solve_status_msg.get(solve_status, "unknown error during call to GLPK : "+str(solve_status))) sage.numerical.mip.MIPSolverException: GLPK: The LP (relaxation) problem has no dual feasible solution
2.0

Sage example in ./lp.tex, line 847::
Expand Down
Loading