| Package | Description |
|---|---|
| berack96.lib.graph | |
| berack96.lib.graph.impl | |
| berack96.lib.graph.models | |
| berack96.lib.graph.view | |
| berack96.lib.graph.view.vertex | |
| berack96.lib.graph.visit | |
| berack96.lib.graph.visit.impl |
| Modifier and Type | Method and Description |
|---|---|
Graph<V,W> |
Graph.subGraph(java.lang.Object... marker)
Get a sub-graph of the current one with only the vertex marked with the selected markers.
Each vertex will have all his edges, but only the ones with the destination marked with the same marker. If the marker is not specified or is null then the returning graph will have all the vertices that are not marked by any marker. If the graph doesn't contain any vertex with that marker then an empty graph is returned. |
Graph<V,W> |
Graph.subGraph(V source,
int depth)
Get a sub-graph of the current one based on the maximum depth that is given.
If the depth is 1 then only the source and it's children will be in the sub-graph. If the depth is 2 then only the source, it's children and it's children of it's children will be in the sub-graph. And so on. Of course the sub-graph will contain the edges that link the vertices, but only the one selected. |
Graph<V,W> |
Graph.transpose()
This method will create a new Graph that is the transposed version of the original.
At the end of this method the new graph will have all the edges inverted in orientation. Example: if the graph G contains (V1, V2, V3) as vertex, and (V1->V2, V3->V2) as edges, the transpose graph G' will contain (V1, V2, V3) as vertex, and (V2->V1, V2->V3) as edges. |
| Modifier and Type | Method and Description |
|---|---|
static <V,W extends java.lang.Number> |
Graph.load(Graph<V,W> graph,
java.lang.String file,
java.lang.Class<V> classV,
java.lang.Class<W> classW)
Load an already saved graph in an instance of a graph.
|
static void |
Graph.save(Graph<?,?> graph,
java.lang.String file)
Save the Graph passed as input to a file inserted as parameter.
The resulting file is a Json string representing all the graph. If the directory for getting through the file do not exist, then it is created. For now the marks are not included. |
static void |
Graph.save(Graph<?,?> graph,
java.lang.String other,
java.lang.String file)
Save the Graph passed as input to a file inserted as parameter.
The resulting file is a Json string representing all the graph. If the directory for getting through the file do not exist, then it is created. For now the marks are not included. The additional parameter is used if you want to save other as well as the graph. |
| Constructor and Description |
|---|
Vertex(Graph<V,?> graph,
V vertex)
Get a Vertex linked with the graph
|
| Modifier and Type | Class and Description |
|---|---|
class |
AdjGraph<V,W extends java.lang.Number> |
class |
MapGraph<V,W extends java.lang.Number>
Graph that uses HashMap for vertices and edges
More specifically it utilizes a Map containing all the vertices mapped to all their edges Technically this version of the graph combine the fast adding/removing of the edges of the Matrix implementation, with the low memory and fast adding/removing of vertices of the Linked List implementation. This happen if the HashMap is not reallocated. |
class |
MatrixGraph<V,W extends java.lang.Number> |
| Modifier and Type | Method and Description |
|---|---|
Graph<V,W> |
MatrixGraph.subGraph(java.lang.Object... marker) |
Graph<V,W> |
MapGraph.subGraph(java.lang.Object... marker) |
Graph<V,W> |
AdjGraph.subGraph(java.lang.Object... marker) |
Graph<V,W> |
MatrixGraph.subGraph(V source,
int depth) |
Graph<V,W> |
MapGraph.subGraph(V source,
int depth) |
Graph<V,W> |
AdjGraph.subGraph(V source,
int depth) |
Graph<V,W> |
MatrixGraph.transpose() |
Graph<V,W> |
MapGraph.transpose() |
Graph<V,W> |
AdjGraph.transpose() |
| Constructor and Description |
|---|
GraphSaveStructure(Graph<?,?> graph,
java.lang.String other) |
| Modifier and Type | Method and Description |
|---|---|
Graph<V,W> |
GraphPanel.getGraph() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Integer |
VertexIntListener.buildNewVertex(Graph<java.lang.Integer,?> graph) |
protected abstract V |
VertexListener.buildNewVertex(Graph<V,?> graph) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Edge<V,W>> |
VisitDistSourceDest.distance(Graph<V,W> graph,
V source,
V destination)
Get the distance from the source to the destination
The list contains the minimum path from the vertex marked as source to the destination vertex |
VisitInfo<V> |
VisitStrategy.visit(Graph<V,W> graph,
V source,
java.util.function.Consumer<V> visit)
With this the graph will be visited accordingly to the strategy of the visit.
Some strategy can accept a source vertex null, because they visit all the graph anyway. If you want to stop the visit of the graph, you just have to throw any exception in the visit function, but be sure to catch it |
| Modifier and Type | Method and Description |
|---|---|
VisitInfo<V> |
Tarjan.visit(Graph<V,W> graph,
V source,
java.util.function.Consumer<V> visit)
This particular visit strategy use only the graph and the visit, so the source param is not needed.
|
VisitInfo<V> |
Dijkstra.visit(Graph<V,W> graph,
V source,
java.util.function.Consumer<V> visit) |
VisitInfo<V> |
DFS.visit(Graph<V,W> graph,
V source,
java.util.function.Consumer<V> visit) |
VisitInfo<V> |
BFS.visit(Graph<V,W> graph,
V source,
java.util.function.Consumer<V> visit) |