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

(disjoint) Union of graphs with multiple edges #15627

Closed
nathanncohen mannequin opened this issue Jan 3, 2014 · 17 comments
Closed

(disjoint) Union of graphs with multiple edges #15627

nathanncohen mannequin opened this issue Jan 3, 2014 · 17 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 3, 2014

Err... Right now, the disjoint union of two graphs with multiedges/loops is the disjoint union of those two graphs without loops nor multiple edges. That's clearly missing from the code.

Here is the new behaviour

Multiple edges and loops::                                                                                                                                                             
                                                                                                                                                                                               
            sage: g = Graph(multiedges=True, loops=True)                                                                                                                                       
            sage: g.add_edges(graphs.PetersenGraph().edges())                                                                                                                                  
            sage: g.add_edges(graphs.PetersenGraph().edges())                                                                                                                                  
            sage: g.add_edge(0,0)                                                                                                                                                              
            sage: g.add_edge(0,0,"Hey")                                                                                                                                                        
            sage: g.add_edge(0,9)                                                                                                                                                              
            sage: g.add_edge(0,9)                                                                                                                                                              
            sage: g.add_edge(0,9)                                                                                                                                                              
            sage: (2*g.size()) == (2*g).size()                                                                                                                                                 
            True                                                                                                                                                                               
                                                                                                                                                                                               
        Immutable input ? Immutable output::                                                                                                                                                   
                                                                                                                                                                                               
            sage: g = g.copy(immutable=True)                                                                                                                                                   
            sage: (2*g)._backend                                                                                                                                                               
            <class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>  

I hate multiedges. I hate loops. I hate labels.

Nathann

Depends on #15623

CC: @simon-king-jena @fchapoton

Component: graph theory

Author: Nathann Cohen

Branch: 9f1716e

Reviewer: Frédéric Chapoton

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

@nathanncohen nathanncohen mannequin added this to the sage-6.1 milestone Jan 3, 2014
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jan 3, 2014

Changed dependencies from #15603 to #15623

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jan 3, 2014

Branch: u/ncohen/15627

@nathanncohen

This comment has been minimized.

@nathanncohen nathanncohen mannequin added the s: needs review label Jan 3, 2014
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 3, 2014

Commit: 6cb609d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 3, 2014

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

6cb609dtrac #15627: (disjoint) Union of graphs with multiple edges
b6ed038trac #15623: Immutable graph backend for Posets
0f57805trac #15622: Immutable graphs must not be relabeled
c441178trac #15619: bug in the former definition; exception to avoid it in the future
0229348trac #15619: Pickling of immutable graphs
7860f39trac #15603: "immutable=True" for Graph/Digraph `__init__` and copy()
2525d22Trac 15278: Fix syntax error in doc test
fcf9e30Trac 15278: Only graphs that use the static backend are identical with their copy
8fc9c94Merge branch 'develop' into ticket/15278
51d6328Trac 15278: Error messages explain how to create (im)mutable graph copy

@fchapoton
Copy link
Contributor

comment:3

There is a typo "afinite projective plane"

I propose to replace "No other value is available for this parameter." by

"For the moment, no other value is available for this parameter."

@fchapoton
Copy link
Contributor

comment:4

oops, wrong ticket !

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@fchapoton
Copy link
Contributor

comment:6

There is a failing doctest about the immutability :

sage: (2*g)._backend
    Traceback (most recent call last):
      ...
    NotImplementedError: An immutable graph does not change name

I suggest also to add a reference to :trac:`15627`

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 11, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

a79d1b0trac #15627: rebase on 6.2.beta3
9f1716etrac #15627: Fixed doctest

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 11, 2014

Changed commit from 6cb609d to 9f1716e

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 11, 2014

comment:9

Here it is !

Nathann

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:10

Ok, good enough for me (even if not fully pep8 or python3)

:)

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Mar 11, 2014

comment:11

Ahahah. Thanks for the review :-)

Nathann

@vbraun
Copy link
Member

vbraun commented Mar 14, 2014

Changed branch from u/ncohen/15627 to 9f1716e

@fchapoton
Copy link
Contributor

Changed commit from 9f1716e to none

@fchapoton

This comment has been minimized.

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

2 participants