#7288: Gomory-Hu Trees
----------------------------+-----------------------------------------------
Reporter: ncohen | Owner: rlm
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.3.4
Component: graph theory | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
----------------------------+-----------------------------------------------
Changes (by abmasse):
* status: needs_review => needs_work
Comment:
Hello again !
I tested your patch with ``sage -t generic_graph.py graph.py`` and it
works ok, but when I type ``sage -t -optional generic_graph.py graph.py``,
I get the following:
{{{
[~/Applications/sage/devel/sage-t7288/sage/graphs]$ sage -t
generic_graph.py graph.py
sage -t "devel/sage-t7288/sage/graphs/generic_graph.py"
[35.4 s]
sage -t "devel/sage-t7288/sage/graphs/graph.py"
[14.9 s]
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 50.3 seconds
[~/Applications/sage/devel/sage-t7288/sage/graphs]$ sage -t -optional
generic_graph.py graph.py
sage -t -optional "devel/sage-t7288/sage/graphs/generic_graph.py"
1 variables fixed
1 variables fixed
1 variables fixed
1 variables fixed
3 variables fixed
3 variables fixed
3 variables fixed
**********************************************************************
File
"/Users/alexandre/Applications/sage/devel/sage-t7288/sage/graphs/generic_graph.py",
line 3795:
sage: [cardinal, flow_graph] =
g.flow('s','t',integer=True,value_only=False) # optional - requries GLPK
or CBC
Exception raised:
Traceback (most recent call last):
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/alexandre/Applications/sage/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_65[9]>", line 1, in <module>
[cardinal, flow_graph] =
g.flow('s','t',integer=True,value_only=False) # optional - requries GLPK
or CBC###line 3795:
sage: [cardinal, flow_graph] =
g.flow('s','t',integer=True,value_only=False) # optional - requries GLPK
or CBC
File "/Users/alexandre/Applications/sage/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 3818, in flow
p.set_objective(flow_sum(x))
File "mip.pyx", line 615, in
sage.numerical.mip.MixedIntegerLinearProgram.set_objective
(sage/numerical/mip.c:5170)
AttributeError: 'int' object has no attribute 'f'
**********************************************************************
File
"/Users/alexandre/Applications/sage/devel/sage-t7288/sage/graphs/generic_graph.py",
line 3796:
sage: flow_graph.delete_vertices(['s','t'])
# optional - requries GLPK or CBC
Exception raised:
Traceback (most recent call last):
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/alexandre/Applications/sage/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_65[10]>", line 1, in <module>
flow_graph.delete_vertices(['s','t'])
# optional - requries GLPK or CBC###line 3796:
sage: flow_graph.delete_vertices(['s','t'])
# optional - requries GLPK or CBC
NameError: name 'flow_graph' is not defined
**********************************************************************
File
"/Users/alexandre/Applications/sage/devel/sage-t7288/sage/graphs/generic_graph.py",
line 3797:
sage: len(flow_graph.edges(labels=None))
# optional - requries GLPK or CBC
Exception raised:
Traceback (most recent call last):
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/alexandre/Applications/sage/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_65[11]>", line 1, in <module>
len(flow_graph.edges(labels=None))
# optional - requries GLPK or CBC###line 3797:
sage: len(flow_graph.edges(labels=None))
# optional - requries GLPK or CBC
NameError: name 'flow_graph' is not defined
**********************************************************************
File
"/Users/alexandre/Applications/sage/devel/sage-t7288/sage/graphs/generic_graph.py",
line 3954:
sage: g.vertex_disjoint_paths(0,1) # optional - requires GLPK or CBC
Exception raised:
Traceback (most recent call last):
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/alexandre/Applications/sage/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/alexandre/Applications/sage/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_67[3]>", line 1, in <module>
g.vertex_disjoint_paths(Integer(0),Integer(1)) # optional -
requires GLPK or CBC###line 3954:
sage: g.vertex_disjoint_paths(0,1) # optional - requires GLPK or CBC
File "/Users/alexandre/Applications/sage/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 3958, in
vertex_disjoint_paths
[obj, flow_graph] = self.flow(s,t,value_only=False, integer=True,
use_edge_labels=False, vertex_bound=True)
File "/Users/alexandre/Applications/sage/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 3843, in flow
[p.add_constraint([flow[X][v] for X in g[v]],max=1) for v in g if
v!=x and v!=y]
File "mip.pyx", line 670, in
sage.numerical.mip.MixedIntegerLinearProgram.add_constraint
(sage/numerical/mip.c:5484)
AttributeError: 'list' object has no attribute 'f'
**********************************************************************
2 items had failures:
3 of 12 in __main__.example_65
1 of 4 in __main__.example_67
***Test Failed*** 4 failures.
For whitespace errors, see the file
/Users/alexandre/.sage//tmp/.doctest_generic_graph.py
[37.8 s]
sage -t -optional "devel/sage-t7288/sage/graphs/graph.py"
[17.0 s]
----------------------------------------------------------------------
The following tests failed:
}}}
Note that I installed CBC so this is not an installation problem. I don't
really understand where the error comes from. Do you think you could
correct it ? As soon as it is done, I'll resume the review.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7288#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.