| Constructor and Description |
|---|
GraphOperations() |
| Modifier and Type | Method and Description |
|---|---|
E |
createNewEdge(V source,
V destination,
java.lang.Class<?> edgeClass)
Creates a new edge connecting two provided vertices
|
java.util.List<E> |
edgesInCommon(Graph<V,E> graph1,
Graph<V,E> graph2)
Finds edges which the given two graphs have in common
|
Graph<V,E> |
formCycleGraph(java.util.List<V> vertices,
java.lang.Class<?> edgeClass)
Forms a cycle from vertices v1...vn in that order
|
boolean |
isProperSubgraph(Graph<V,E> supergraph,
Graph<V,E> subgraph)
Determines is one graph is a proper subraph of another one
H is a proper subgraph of G, if V(H)!=V(G) || E(H)!=E(G)
|
boolean |
isSubgraph(Graph<V,E> supergraph,
Graph<V,E> subgraph)
Determines is one graph is a subgraph of another one
|
Graph<V,E> |
removeEdgeFromGraph(Graph<V,E> graph,
E edge)
Removes an edge from the graph
|
Graph<V,E> |
union(java.util.List<Graph<V,E>> graphs)
Finds a graph which is a union of the provided list of graphs
|
java.util.List<V> |
verticesInCommon(Graph<V,E> graph1,
Graph<V,E> graph2)
Finds vertices which the given two graphs have in common
|
public java.util.List<V> verticesInCommon(Graph<V,E> graph1, Graph<V,E> graph2)
graph1 - The first graphgraph2 - The second graphgraph1 and graph2 have in commonpublic java.util.List<E> edgesInCommon(Graph<V,E> graph1, Graph<V,E> graph2)
graph1 - The first graphgraph2 - The second graphgraph1 and graph2 have in commonpublic Graph<V,E> union(java.util.List<Graph<V,E>> graphs)
graphs - A list of graphsgraphspublic boolean isSubgraph(Graph<V,E> supergraph, Graph<V,E> subgraph)
supergraph - Potential supergraphsubgraph - Potential subgraphsubgraph is a subgraph of supergraph
false otherwisepublic boolean isProperSubgraph(Graph<V,E> supergraph, Graph<V,E> subgraph)
supergraph - Potential supergraphsubgraph - Potential subgraphtrue if subgraph is a proper subgraph of supergraph
false otherwisepublic Graph<V,E> removeEdgeFromGraph(Graph<V,E> graph, E edge)
graph - Graphedge - Edge to be removedgraph by removing edge edgepublic Graph<V,E> formCycleGraph(java.util.List<V> vertices, java.lang.Class<?> edgeClass)
vertices - A list of verticesedgeClass - Class of the edges of the graphvertices