#18972: twographs and Seidel switching
-------------------------------------+-------------------------------------
Reporter: dimpase | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.9
Component: graph theory | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/dimpase/seidelsw | b76c9a0369a5babc98481d6b96125c9b86f1adc9
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
Hellooooooo,
1) The docstring must begin with a one-line sentence
(http://doc.sagemath.org/html/en/developer/coding_basics.html#the-
docstring-of-a-function-content)
2) small case (e.g.: `Graph.tutte_polynomial`)
3) If your methods only apply to undirected graphs, they should be in
graph.py
4) Add doctests for your new constructor
5) This line is an insult to computer science: {{{idx =
frozenset([self.vertices().index(v) for v in s])}}}It builds a list `n`
times to compute the index of an element with a linear search. And I don't
think that you need a `.Seydel_adjacency_matrix` or a new input type for
this function. You can do it like that:
{{{
sage: g = graphs.PetersenGraph()
sage: s = {1,2,3,4}
sage: sc = set(g).difference(s)
sage: b = g.edge_boundary(s)
sage: g.add_edges((x,y) for x in s for y in sc)
sage: g.delete_edges(b)
}}}
6) A new method must be added to the index at the top of the file.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/18972#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.