#7640: shortest_path should not use NetworkX if the underlying graph is a
c_graph
----------------------------+-----------------------------------------------
Reporter: rlm | Owner: rlm
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.3
Component: graph theory | Keywords:
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
----------------------------+-----------------------------------------------
Comment(by rlm):
I applied the patch here, together with the patch at #7634, (to `4.3.rc0`)
in order to fully test the new functionality, and here are the results of
`-t -long sage/graphs` (files not listed passed):
{{{
sage -t -long "devel/sage-main/sage/graphs/graph.py"
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 5838:
sage: H.is_isomorphic(graphs.CompleteGraph(n))
Expected:
True
Got:
False
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 7329:
sage: g.transitive_reduction().size()
Expected:
5
Got:
6
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 2206:
sage: o.in_degree()
Expected:
[2, 2, 2, 2, 1, 2, 1, 1, 1, 1]
Got:
[2, 2, 2, 2, 2, 1, 1, 1, 1, 1]
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 2208:
sage: o.out_degree()
Expected:
[1, 1, 1, 1, 2, 1, 2, 2, 2, 2]
Got:
[1, 1, 1, 1, 1, 2, 2, 2, 2, 2]
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 4736:
sage: g.degree_sequence()
Exception raised:
Traceback (most recent call last):
File "/Users/rlmill/sage-4.3.rc0/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/rlmill/sage-4.3.rc0/local/bin/sagedoctest.py", line 38,
in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/rlmill/sage-4.3.rc0/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_96[3]>", line 1, in <module>
g.degree_sequence()###line 4736:
sage: g.degree_sequence()
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4754, in degree_sequence
return sorted(self.degree_iterator(), reverse=True)
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4725, in degree_iterator
yield filter(v, self)
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4723, in <lambda>
filter = lambda v, self: self._backend.degree(v, self._directed)
File "c_graph.pyx", line 751, in
sage.graphs.base.c_graph.CGraphBackend.degree
(sage/graphs/base/c_graph.c:7480)
File "c_graph.pyx", line 594, in
sage.graphs.base.c_graph.CGraph._out_degree
(sage/graphs/base/c_graph.c:6472)
RuntimeError: Vertex (5) is not a vertex of the graph.
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-main/sage/graphs/graph.py",
line 4742:
sage: g.degree_sequence()
Exception raised:
Traceback (most recent call last):
File "/Users/rlmill/sage-4.3.rc0/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/rlmill/sage-4.3.rc0/local/bin/sagedoctest.py", line 38,
in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/rlmill/sage-4.3.rc0/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_96[5]>", line 1, in <module>
g.degree_sequence()###line 4742:
sage: g.degree_sequence()
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4754, in degree_sequence
return sorted(self.degree_iterator(), reverse=True)
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4725, in degree_iterator
yield filter(v, self)
File "/Users/rlmill/sage-4.3.rc0/local/lib/python/site-
packages/sage/graphs/graph.py", line 4723, in <lambda>
filter = lambda v, self: self._backend.degree(v, self._directed)
File "c_graph.pyx", line 749, in
sage.graphs.base.c_graph.CGraphBackend.degree
(sage/graphs/base/c_graph.c:7433)
File "c_graph.pyx", line 580, in
sage.graphs.base.c_graph.CGraph._in_degree
(sage/graphs/base/c_graph.c:6372)
RuntimeError: Vertex (6) is not a vertex of the graph.
**********************************************************************
}}}
{{{
sage -t -long "devel/sage-main/sage/graphs/linearextensions.py"
**********************************************************************
File "/Users/rlmill/sage-4.3.rc0/devel/sage-
main/sage/graphs/linearextensions.py", line 360:
sage: l.incomparable(1,2)
Expected:
True
Got:
False
**********************************************************************
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7640#comment:10>
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.