Skip to content
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

implement graph addition #18

Open
akelleh opened this issue May 30, 2013 · 1 comment
Open

implement graph addition #18

akelleh opened this issue May 30, 2013 · 1 comment
Assignees

Comments

@akelleh
Copy link
Collaborator

akelleh commented May 30, 2013

Add a method to the Graph() object that allows adding other graphs.

for g and h both Graph() objects, g.add_graph(h) should return a graph containing the union of the nodes in g and h, and the sum of the edges. You should decide whether we want to 1) add new distinct edges, or 2) simply increase the weight of existing edges when we implement this.

the method should return an error if there exists a node in both g and h with the same name, but different and conflicting attributes (e.g. different edges connecting the same nodes are okay, but different user-defined internal properties are bad. we might need to discuss how to implement this).

@ghost ghost assigned akellehe May 30, 2013
@akellehe
Copy link
Owner

akellehe commented Jun 1, 2013

If the method A.add_graph(B), if there exists a node in B not in A it will be created in the resultant graph. If there exists a node in A not in B it will remain in the resultant graph. If there exists a node in B also in A, the resultant graph will contain that node from B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants