diff --git a/src/doc/en/thematic_tutorials/linear_programming.rst b/src/doc/en/thematic_tutorials/linear_programming.rst index 4baf2936f93..9843eeba821 100644 --- a/src/doc/en/thematic_tutorials/linear_programming.rst +++ b/src/doc/en/thematic_tutorials/linear_programming.rst @@ -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\\ @@ -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 diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py index 733f62c6b13..19d3fb538fb 100644 --- a/src/sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py +++ b/src/sage/tests/books/computational-mathematics-with-sagemath/lp_doctest.py @@ -187,7 +187,7 @@ 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::