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

Graphs: Faster implementation for HalfCube #30509

Closed
Ivo-Maffei mannequin opened this issue Sep 5, 2020 · 11 comments
Closed

Graphs: Faster implementation for HalfCube #30509

Ivo-Maffei mannequin opened this issue Sep 5, 2020 · 11 comments

Comments

@Ivo-Maffei
Copy link
Mannequin

Ivo-Maffei mannequin commented Sep 5, 2020

Implementation of a faster method to construct the graph HalfCube

Depends on #30329

CC: @dimpase @dcoudert

Component: graph theory

Author: Ivo Maffei

Branch/Commit: 898fbee

Reviewer: David Coudert

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

@Ivo-Maffei Ivo-Maffei mannequin added this to the sage-9.2 milestone Sep 5, 2020
@Ivo-Maffei
Copy link
Mannequin Author

Ivo-Maffei mannequin commented Sep 5, 2020

Dependencies: #30329

@Ivo-Maffei
Copy link
Mannequin Author

Ivo-Maffei mannequin commented Sep 5, 2020

Branch: public/graphs/30509

@Ivo-Maffei
Copy link
Mannequin Author

Ivo-Maffei mannequin commented Sep 5, 2020

Commit: 3024980

@Ivo-Maffei
Copy link
Mannequin Author

Ivo-Maffei mannequin commented Sep 5, 2020

comment:1

To convert the vertices of CubeGraph to integers one can use G.relabel(perm=int) as the vertices are strings and int(str) will convert str to its integer representation.

However, doing so causes an overflow error (not sure why) when we iterate over G.
One can simply iterate over range(2**(n-1)), but I think the construction in this branch is even faster as everything happens in Cython without calling CubeGraph.


Last 10 new commits:

97f0450Merge branch 'develop' into t/30312
2a1861dMerge branch 't/30312' into t/30329
5344f35added long time flags and fixed van Lint name
9e69f0dmissing # long time
49cdcc1Merge branch 't/30312' into t/30329
ea30040added long time flags
4bcdb3ctypos and TeX fixes
feabf4fbetter index section, uniform naming
1fdcad9fixed typo
3024980faster implementation of HalfCube

@Ivo-Maffei Ivo-Maffei mannequin added the s: needs review label Sep 5, 2020
@dcoudert
Copy link
Contributor

dcoudert commented Sep 5, 2020

comment:2

It's of course faster to not call CubeGraph. The drawback is to lose the placement of vertices done in CubeGraph (which is certainly the most expensive part of the method).

a minor improvement:

-    G = Graph(E, format='list_of_edges')
+    G = Graph([range(2**(n - 1)), E], format='vertices_and_edges')

also, may be it's enough to put the sig_check before the for i... loop ?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 6, 2020

Changed commit from 3024980 to 898fbee

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 6, 2020

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

898fbeeadded positions to HalfCube

@dcoudert
Copy link
Contributor

dcoudert commented Sep 6, 2020

Author: Ivo Maffei

@dcoudert
Copy link
Contributor

dcoudert commented Sep 6, 2020

Reviewer: David Coudert

@dcoudert
Copy link
Contributor

dcoudert commented Sep 6, 2020

comment:4

LGTM, and the plots are nice.

@vbraun
Copy link
Member

vbraun commented Sep 23, 2020

Changed branch from public/graphs/30509 to 898fbee

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