Closed c703ac91-1c31-4f3a-abb2-47af3ac2705d closed 7 years ago
Commit: 7f07803
New commits:
7f07803 | bipartite graph mathchings |
Description changed:
---
+++
@@ -1 +1 @@
-
+The Hopcroft-Karp and Eppstein algorithms as implemented in NetworkX compute matchings for bipartite graphs faster than the algorithms for general graphs. I've included an override of the matching method in the bipartite graph class, with parameters that allow for using the old algorithms if desired.
Branch pushed to git repo; I updated commit sha1. New commits:
22ba202 | libraries for compatibility |
Branch pushed to git repo; I updated commit sha1. New commits:
d6215f1 | removed tab character |
Work Issues: author is missing
zgershkoff, I could not find your handle on the wiki home page.
Author: Zachary Gershkoff
I don't see anything in the developer's guide about this. Is this sufficient?
Branch pushed to git repo; I updated commit sha1. New commits:
0da102a | fixed whitespace issue |
Changed work issues from author is missing to none
Replying to @sagetrac-zgershkoff:
I don't see anything in the developer's guide about this. Is this sufficient?
Yes. It is probably not in the developer's guide. But the merge commit uses that information (and the Reviewer field) afaik. It would be great if you could also add yourself to the list on the wiki's homepage.
I made some minor changes. Let's see what the patchbots think about this.
Changed branch from u/zgershkoff/matchings_in_bipartite_graphs to u/saraedum/matchings_in_bipartite_graphs
Reviewer: Julian Rüth
The patchbot says it fails python3 compatibility when it calls six.iteritems, which I find confusing-- I thought the purpose of the six library was python2-3 compatibility.
Just a hunch here: maybe you need to write "for (u, v) in six.iteritems..."?
I couldn't find anything online justifying this.
Patchbot is not smart enough to recognize the six before iteritems.
You should rather use
from six import iteritems
...
for u,v in iteritems
Three other minor things:
You should start with
def matching(self, value_only=False, algorithm="Hopcroft-Karp",
use_edge_labels=False, solver=None, verbose=0):
r"""
(and end with """
).
For the wikipedia, use
:wikipedia:`Matching_(graph_theory)`
which handles all of the linking and formatting.
Change the first use_edge_labels
to:
- when set to ``True``, computes a weighted matching where each
edge is weighted by its label (if an edge has no label, `1` is
assumed); ignored if ``algorithm`` is not ``"Edmonds"``, ``"LP"``
Changed branch from u/saraedum/matchings_in_bipartite_graphs to u/zgershkoff/matchings_in_bipartite_graphs
Branch pushed to git repo; I updated commit sha1. New commits:
4cabf0b | wrong kind of apostrophe |
I made all the documentation changes tscrim suggested except the last one, which I believe saraedum already addressed.
Replying to @fchapoton:
Patchbot is not smart enough to recognize the six before iteritems.
I changed it to just iteritems
in bipartite_graph.py, but the way I had it before is exactly how it was used in graph.py. I didn't fix it in graph.py since it's not broken.
No, Julian did not address it already; in particular there are still 2 commas separated by a space. I also (slightly) think you should aim to make it not use periods to be consistent and concise.
Changed reviewer from Julian Rüth to Julian Rüth, Travis Scrimshaw
Branch pushed to git repo; I updated commit sha1. New commits:
6dd7eaa | typo and style fixes |
Ok, I see. Thank you for the feedback. I fixed the things you pointed out, but I changed the phrasing away from "ignored if algorithm
is not "Edmonds"
, "LP"
" because it's now configured to raise an error if use_edge_labels==True
but algorithm
is not set to "Edmonds"
or "LP"
.
New commits:
6dd7eaa | typo and style fixes |
Branch pushed to git repo; I updated commit sha1. New commits:
a20b717 | typo fix |
You need to revert back the indentation by 2 spaces.
Branch pushed to git repo; I updated commit sha1. New commits:
e3c353e | fixed indentation |
You also need to do the other two lines. See comment:17 (also, it would be good if the arguments for the function started at the same level, it's a PEP8 thing).
Replying to @tscrim:
You also need to do the other two lines. See comment:17 (also, it would be good if the arguments for the function started at the same level, it's a PEP8 thing).
I believe the lines you're referring to are addressed in this commit https://github.com/sagemath/sagetrac-mirror/commit/5339528b85dd389a3e7633678fe609796fe787b0 - I'm not sure why it didn't show up in the trac ticket.
I'll look into PEP8 and make changes shortly.
Branch pushed to git repo; I updated commit sha1. New commits:
fadefcb | PEP8 compliance |
Branch pushed to git repo; I updated commit sha1. New commits:
96b1242 | Removed tab character from new lines |
Branch pushed to git repo; I updated commit sha1. New commits:
0d0bbbc | newline at end of file |
I think this looks good now. Travis, do you agree?
Whoops, sorry this fell of my radar. Yep, looks good.
Why don't you use G.networkx_graph()
to get the networkx version of the graph ?
The Hopcroft-Karp and Eppstein algorithms as implemented in NetworkX compute matchings for bipartite graphs faster than the algorithms for general graphs. I've included an override of the matching method in the bipartite graph class, with parameters that allow for using the old algorithms if desired.
Component: graph theory
Author: Zach Gershkoff
Branch:
5924a34
Reviewer: Julian Rüth, Travis Scrimshaw, David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/22559