Thanks for pointing to the new thread. :-)
Yes, the same problem exists for add_edge(). At a minimum, and add/
delete vertex and add edge code needs to be overridden for
BipartiteGraph. I've done the delete vertex and can do the others,
but I wanted to clear up the long-term approach first.
-
On Feb 26, 8:03 pm, Robert Miller r...@rlmiller.org wrote:
On Fri, Feb 26, 2010 at 9:05 AM, Ryan Hinton iob...@email.com wrote:
...
OK, assume we solve (1) by requiring an indication of which partition
a vertex belongs in and raising an exception otherwise. What about
Graph algorithms
A. Change BipartiteGraph so that it doesn't inherit from Graph.
B. Make BipartiteGraph handling an integral part of the Graph class...
C. ... BipartiteGraph is a subclass of Graph and overrides methods
when necessary.
On Mon, Mar 1, 2010 at 9:55 AM, Ryan Hinton iob...@email.com wrote:
It
+1 to Robert's arguments. Using class inheritance as much as you can is the
way to go.
David
On Mon, Mar 1, 2010 at 3:18 PM, Robert Miller r...@rlmiller.org wrote:
A. Change BipartiteGraph so that it doesn't inherit from Graph.
B. Make BipartiteGraph handling an integral part of the Graph
For the impatient, I'll give the summary here at the top.
For what it's worth, my current opinion is that a mixture of options
(B) and (C) are probably best. Given the backend abstraction,
overriding the core public interface (add/delete_edge, add/
delete_vertex) will result in most methods
This will be my last post on the topic for now.
On Mon, Mar 1, 2010 at 2:45 PM, Ryan Hinton iob...@email.com wrote:
Again, the wishful thinking is the assumptions. Here are a few
examples.
* The copy() method calls the DiGraph and Graph constructors
directly. To get all the same
On 03/01/2010 04:45 PM, Ryan Hinton wrote:
As for your documentation solution, I think this is where we
disagree. If I use tab completion and find a method hanging on a
BipartiteGraph instance, I expect it to work. In other words, if it
is written, documented, and tested in generic_graph.py
Hi Ryan,
Thanks for working on this. I didn't even know this class
existed. ;-) Some comments.
+1 to Robert Miller's suggestion that a new vertex should be assigned
to one part of the bipartition in the call, or else an error will be
raised. At a minimum, encountering such an error will let
Thanks for the reply. Response to your suggestions below.
On Feb 26, 1:21 pm, David Joyner wdjoy...@gmail.com wrote:
...snip...
I considered another option. Why not just wait until an edge is added
to figure out whether a node is left or right? Because all the
vertices should be in one