-
-
Notifications
You must be signed in to change notification settings - Fork 511
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: simple bipartite double method added to undirected graphs #30355
Comments
comment:1
The dependency on #30240 is only needed to avoid a merge conflict in the master bibliography |
Commit: |
Branch: public/graphs/30355 |
Last 10 new commits:
|
Reviewer: David Coudert |
comment:3
Several comments:
- The bipartite double of a graph `G` has vertices
- `\{ (v,0), (v,1) : v \in G\}` and for any edge `(u, v)` in `G`
- we have edges `((u,0),(v,1))` and `((u,1),(v,0))`.
- Note that this is the tensor product of `G` with `K_2`.
- See :
+ The bipartite double of a graph `G` has vertex set
+ `\{ (v,0), (v,1) : v \in G\}` and for any edge `(u, v)` in `G`
+ it has edges `((u,0),(v,1))` and `((u,1),(v,0))`.
+ Note that this is the tensor product of `G` with `K_2`.
- - ``extended`` -- boolean (optional); if ``True`` return the extended
- bipartite double, else the bipartite double. Default: ``False``.
+ - ``extended`` -- boolean (default: ``False``); Whether to return the extended
+ bipartite double, or only the bipartite double (default)
- if extended:
- for v in self:
- v1 = (v, 0)
- v2 = (v, 1)
-
- G.add_edge((v1, v2))
+ if extended:
+ G.add_edges(((v, 0), (v, 1)) for v in self)
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
Replying to @dcoudert:
I based this branch on #30240 because otherwise the reference [VDKT2016] would not work.
I mentioned it in the
I added this cases in the |
comment:6
LGTM. |
Changed branch from public/graphs/30355 to |
The bipartite double of a graph is its tensor product with the graph K_2.
A simple method
bipartite_double(extended=False)
is added to the undirected graph class in order to compute the bipartite double and the extended bipartite double of a graph.Depends on #30240
CC: @dimpase
Component: graph theory
Author: Ivo Maffei
Branch/Commit:
2d6c8ba
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/30355
The text was updated successfully, but these errors were encountered: