#12155: Bug when taking complement of bipartite graph.
----------------------------+-----------------------------------------------
Reporter: fidelbarrera | Owner: jason, ncohen, rlm
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: graph theory | Keywords: bipartite, complement
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
----------------------------+-----------------------------------------------
Changes (by rbeezer):
* status: needs_review => needs_work
Comment:
I got two errors on 4.8.alpha3. Error messages ({{{print "Error!"}}})
could be cleaned-up in the first.
{{{
rob@lava:/sage/sage-4.8.alpha3/devel/sage$ ../../sage -t devel/sage-
main/sage/graphs/graph.py
sage -t "devel/sage-main/sage/graphs/graph.py"
**********************************************************************
File "/sage/sage-4.8.alpha3/devel/sage-main/sage/graphs/graph.py", line
1475:
sage: if not g.is_forest():
cycle = g.is_even_hole_free(certificate = True)
if cycle.order() % Integer(2) == Integer(1):
print "Error !"
if not cycle.is_isomorphic(
graphs.CycleGraph(cycle.order())):
print "Error !"
Exception raised:
Traceback (most recent call last):
File "/sage/sage-4.8.alpha3/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/sage/sage-4.8.alpha3/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/sage/sage-4.8.alpha3/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_6[8]>", line 2, in <module>
cycle = g.is_even_hole_free(certificate = True)
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/graph.py", line 1528, in is_even_hole_free
subgraph =
self.subgraph_search(GraphGenerators().CycleGraph(start), induced = True)
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 9444, in subgraph_search
return self.subgraph(g)
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 9071, in subgraph
edge_property=edge_property)
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 9328, in
_subgraph_by_deleting
G = self.copy()
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/generic_graph.py", line 472, in __copy__
G = self.__class__(self, name=self.name(), pos=copy(self._pos),
boundary=copy(self._boundary), implementation=implementation,
sparse=sparse)
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/graph.py", line 1085, in __init__
pos = data.get_pos().copy()
AttributeError: 'list' object has no attribute 'copy'
**********************************************************************
File "/sage/sage-4.8.alpha3/devel/sage-main/sage/graphs/graph.py", line
1500:
sage: all( t(graphs.RandomBipartite(10,10,.5)) for i in range(100) )
Exception raised:
Traceback (most recent call last):
File "/sage/sage-4.8.alpha3/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/sage/sage-4.8.alpha3/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/sage/sage-4.8.alpha3/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_6[14]>", line 1, in <module>
all(
t(graphs.RandomBipartite(Integer(10),Integer(10),RealNumber('.5'))) for i
in range(Integer(100)) )###line 1500:
sage: all( t(graphs.RandomBipartite(10,10,.5)) for i in range(100) )
File "<doctest __main__.example_6[14]>", line 1, in <genexpr>
all(
t(graphs.RandomBipartite(Integer(10),Integer(10),RealNumber('.5'))) for i
in range(Integer(100)) )###line 1500:
sage: all( t(graphs.RandomBipartite(10,10,.5)) for i in range(100) )
File "<doctest __main__.example_6[13]>", line 1, in <lambda>
t = lambda x : (Graph(x).is_forest() or###line 1498:
sage: t = lambda x : (Graph(x).is_forest() or
File "/sage/sage-4.8.alpha3/local/lib/python/site-
packages/sage/graphs/graph.py", line 1085, in __init__
pos = data.get_pos().copy()
AttributeError: 'list' object has no attribute 'copy'
**********************************************************************
1 items had failures:
2 of 16 in __main__.example_6
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/rob/.sage//tmp/graph_18917.py
[12.0 s]
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12155#comment:5>
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.