New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contraction of edges in a graph. #13239
Comments
Author: Lauren Keough, Jeremy Martin |
Attachment: trac_13239.patch.gz |
Changed keywords from none to SD40 |
Reviewer: Marshall Hampton |
Changed reviewer from Marshall Hampton to Marshall Hampton, David Coudert |
comment:4
Hello, I don't understand this new patch. If the behavior of the contract_edge function proposed in patch #7304 is not adapted to your purpose, you could add extra parameters (inplace = False, keep_multiedges, etc.) Furthermore, it works only for undirected graphs. So it should at least be in graph.py and not in generic_graph.py. In the following example, arc (3,0) becomes arc (0,3)
D. |
comment:5
Replying to @dcoudert:
#7304 will keep multiedges if you do G.allow_multiedges . However, we also need to do G.allow_loops (for the tutte polynomial), but if we do that then the patch leaves the contracted edge (rather than deleting it which is what we want). I suppose I could use their code and then add a line to mine that deletes that loop. I'm not really sure what the best option is here. 7304 already has a lot of parameters and adding another might be very confusing. And I'm also not sure what most people mean by contracting an edge - I thought the definition I have written in this code was "the" definition, but it's becoming more apparent that it isn't at all! Perhaps I could just include this code in the Tutte polynomial code and not as a separate function? I'm very open to advice on this!
Okay, I will definitely move to graph.py unless I can figure out how to make it work for digraphs.
|
comment:6
If the #7304 function is not adapted to your purpose, it could be better to include the code in your function instead of creating a new one. May be some people from Sage Days could give good advise. |
comment:7
Replying to @dcoudert:
A couple of graph theorists at Sage Days said they would prefer to have a function by the name of contraction that does what I described in the documentation for this one. It is very easy to adapt their code and call it contraction. I'm going to try both things and time them to see which is faster. Thanks! |
Contracts edges in a graph so that we can compute the Tutte polynomial (#1314)
This version of contracting edges is different from #7304 (this code will keep resulting multiedges and remove contracted edge).
CC: @sagetrac-jeremy-l-martin @dcoudert
Component: graph theory
Keywords: SD40
Author: Lauren Keough, Jeremy Martin
Reviewer: Marshall Hampton, David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/13239
The text was updated successfully, but these errors were encountered: