#19586: Add is_cayley_graph
-------------------------------------+-------------------------------------
Reporter: jaanos | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.10
Component: graph theory | Resolution:
Keywords: Cayley graphs | Merged in:
groups | Reviewers:
Authors: Janoš Vidali | Work issues:
Report Upstream: N/A | Commit:
Branch: | baba4a8d4919be000984d40f56db542557c55e51
u/jaanos/add_is_cayley_graph | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by ncohen):
Sorry, I was rather angry. Longer answer:
> * I have added a method `cayley_graph_group`, as suggested, which takes
care of obtaining the group (or actually computing it in the case of
disconnected graphs). It can be instructed not to actually return the
group, but only to tell whether the graph is Cayley or not.
>
> * `is_cayley` calls the above method, requesting the group if a
certificate is requested. The certificate is now a copy of the graph with
edges labelled by members of the generating set, and vertices associated
to group elements (vertex names are not changed). One may then test that
the result is indeed a Cayley graph - an example is in the doctest. Of
course, once we will have a separate class/backend for Cayley graphs, we
can use that here.
I am still against the presence of both 'is_cayley' and
'cayley_graph_group', especially if you say that the first does the job of
the second already. Let us not have 300 ways to do the same thing.
In particular, I often saw often users do things like:
{{{
if self.is_cayley():
G = self.cayley_graph_group()
}}}
Which means that they compute things twice, whenever they have both a
`is_*` function and another one which returns the data they are actually
after.
I'm beginning to think that a `is_cayley_graph` that would return the
group if possible and False otherwise would do the job, though that's only
me.
> * Since `set_edge_label` does not work for multiedges, I have added
three new parameters to `copy`. One is `data`, specifying the actual graph
data to be copied (so this can be anything `Graph` and `DiGraph` accept -
in this case, a list of vertices and a list of labelled edges). The other
two are `loops` and `multiedges` (I don't actually use them in the final
version, but I figured it might be still useful to keep them). Any of the
properties of the graph not specified as a parameter are obtained from the
graph itself, not from whatever `data` is.
Keywords like 'data' caused me endless troubles in this library. It is far
too unspecific, and I do not even think that you need something it. From
what you said it seems that you only need to perform a copy then call
`to_simple`. Tell me if it isn't what you want.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/19586#comment:54>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.