|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelix.graph.algo.Cloner
public class Cloner
a class to duplicate graphs or parts of graph
Method Summary | |
---|---|
static Graph |
cloneGraph(Graph src)
clone a graph completely same as subGraph(g, g.vertices()) |
static Vertex |
duplicateVertex(Graph graph,
Vertex v)
duplicate a single vertex in a graph note: this is quicker than calling duplicateVertices with a singleton
-1- duplicate vertex v to copy(v)
-2- foreach edge (v, u)
createEdge(copy(v), u)
|
static GSet<Vertex> |
duplicateVertices(Graph graph,
GSet<Vertex> vertices)
duplicate a set of vertices within the same graph
-1- duplicate each vertex v in vertices to copy(v)
-2- foreach vertex v in vertices
foreach edge (v, u)
createEdge(copy(v), u')
with u' = (hasCopy(u) ? copy(u) : u)
|
static Graph |
subGraph(Graph src,
Iterable<Vertex> vertices)
make a subgraph from graph restricted to given vertices |
static Graph |
union(Graph g1,
Graph g2)
make union of two disjoints graphs |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Graph subGraph(Graph src, Iterable<Vertex> vertices)
public static Graph cloneGraph(Graph src)
public static Graph union(Graph g1, Graph g2)
public static GSet<Vertex> duplicateVertices(Graph graph, GSet<Vertex> vertices)
-1- duplicate each vertex v in vertices to copy(v)
-2- foreach vertex v in vertices
foreach edge (v, u)
createEdge(copy(v), u')
with u' = (hasCopy(u) ? copy(u) : u)
graph
- Graph to modifyvertices
- subset of vertices in graph
public static Vertex duplicateVertex(Graph graph, Vertex v)
-1- duplicate vertex v to copy(v)
-2- foreach edge (v, u)
createEdge(copy(v), u)
graph
- Graph to modifyv
- Vertex to duplicate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |