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

Error creating an empty multi-edge (di)graph #10441

Closed
sagetrac-mhs mannequin opened this issue Dec 8, 2010 · 11 comments
Closed

Error creating an empty multi-edge (di)graph #10441

sagetrac-mhs mannequin opened this issue Dec 8, 2010 · 11 comments

Comments

@sagetrac-mhs
Copy link
Mannequin

sagetrac-mhs mannequin commented Dec 8, 2010

In SAGE 4.5.1 if you try to create an empty graph or digraph using the multi-edge keyword the (di)graph created is a non-multi (di)graph.

Examples of the strange behaviour:

sage: G=Graph(multiple_edges=True)
sage: G
Graph on 0 vertices
sage: G=Graph([],multiple_edges=True)
sage: G
Graph on 0 vertices
sage: H=DiGraph(multiple_edges=True)
sage: H
Digraph on 0 vertices
sage: H=DiGraph([],multiple_edges=True)
sage: H
Digraph on 0 vertices

Nevertheless it works fine, i.e. produces a multi-graph/multi-digraph if one uses an empty dictionary like in the following:

sage: G=Graph({},multiple_edges=True)
sage: G
Multi-graph on 0 vertices
sage: H=DiGraph({},multiple_edges=True)
sage: H
Multi-digraph on 0 vertices

After posting on sage-develop Strange behaviour of add_edges http://groups.google.com/group/sage-devel/browse_thread/thread/69773eae8ba3cefc I was asked to open a new ticket...

CC: @sagetrac-mvngu @sagetrac-brunellus

Component: graph theory

Keywords: creating empty Graph, DiGraph, multiple_edges=True

Author: Lukáš Lánský

Reviewer: Nathann Cohen

Merged: sage-5.0.beta3

Issue created by migration from https://trac.sagemath.org/ticket/10441

@sagetrac-mhs sagetrac-mhs mannequin added this to the sage-5.0 milestone Dec 8, 2010
@sagetrac-mhs

This comment has been minimized.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Dec 8, 2010

Changed upstream from Not yet reported upstream; Will do shortly. to none

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Dec 8, 2010

Changed author from MHS to none

@sagetrac-brunellus
Copy link
Mannequin

sagetrac-brunellus mannequin commented Jan 13, 2012

comment:4

I think that having **kwds in the Graph constructor is very confusing, because any misspelling of an argument pass through without notice. Do you see some serious reason why is this there? I'm looking into the code and can't see anything.

@sagetrac-brunellus
Copy link
Mannequin

sagetrac-brunellus mannequin commented Jan 20, 2012

comment:5

I started #12318 for the mentioned problem.

Fix for this ticket is a rather simple one, I think. Prove me wrong! :-)

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 29, 2012

comment:6

Hellooooooooooooo !!

Well, the code building the graph is a bit messy but indeed what you wrote 1) prevents the bug 2) is what we should do until somebody comes with another weird situation :-)

Would it be possible to move your "# not a multi [...]" comments to the line just above the test, though ? That's where we put flags like "optional" or "not tested" for the automatic tests, and it's best to be sure these comments do not interfere ^^;

Nathann

@sagetrac-brunellus
Copy link
Mannequin

sagetrac-brunellus mannequin commented Jan 31, 2012

comment:8

Attachment: trac_10441_multigraph.patch.gz

Thanks! Is it better now?

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 31, 2012

comment:9

Hellooooooo !!!

I thought you would put the comments just before the "::" but there's no problem with way either... Good to go ! :-)

Nathann

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 31, 2012

Reviewer: Nathann Cohen

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 31, 2012

Author: Lukáš Lánský

@jdemeyer
Copy link

jdemeyer commented Feb 6, 2012

Merged: sage-5.0.beta3

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

No branches or pull requests

1 participant