T - The type of event this graph has for edge labelsU - The type of the categories in the Cayley Graphpublic class CayleyGraph<T extends Event,U> extends LabelledGraph<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
CayleyGraph.IsomorphismException |
static class |
CayleyGraph.LabelFormatter<X> |
LabelledGraph.DepthVisitors_maxRecursionSteps| Constructor and Description |
|---|
CayleyGraph()
Creates an empty graph
|
CayleyGraph(CayleyGraph<T,U> graph)
Creates a copy of a Cayley graph
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkMapping(int current_node_id,
CayleyGraph<T,U> other_graph,
int other_node_id,
java.util.Map<java.lang.Integer,java.lang.Integer> mapping) |
protected Edge<T> |
findEdgeWithLabel(java.util.Set<Edge<T>> edges,
T label) |
float[][] |
getAdjacencyMatrix()
Produces the adjacency matrix of the Cayley Graph.
|
java.util.Map<MathSet<U>,java.lang.Integer> |
getClassCardinality(int length,
boolean cumulative)
Computes the number of traces of a given length that belong to
each equivalence class
|
java.util.Map<java.lang.Integer,java.util.Set<MathSet<U>>> |
getClassesByDepth()
Produces a map telling what are the equivalence classes reachable
at each depth of the Cayley graph
|
protected void |
getClassesByDepth(java.util.Map<java.lang.Integer,java.util.Set<MathSet<U>>> map,
java.util.Map<MathSet<U>,java.lang.Integer> visited,
java.util.Set<java.lang.Integer> visited_ids,
Vertex<T> node,
int cur_depth,
int max_depth)
Produces a map telling what are the equivalence classes reachable
at each depth of the Cayley graph
|
protected Edge<T> |
getEdgeWithDestinationId(java.util.Set<Edge<T>> edges,
T label,
int id) |
protected Vertex<T> |
getFirstVertexWithLabelling(MathSet<U> eq_class)
Gets the first vertex that is labelled with a given equivalence class
|
CayleyVertexLabelling<U> |
getLabelling()
Gets the labelling associated to the vertices of the graph
|
boolean |
isIsomorphicTo(CayleyGraph<T,U> other_graph)
Determines if some graph is isomorphic to the current graph.
|
boolean |
isIsomorphicToThrowable(CayleyGraph<T,U> other_graph)
Same as
isIsomorphicTo(CayleyGraph) but throws an exception
explaining why the graphs are not isomorphic when they are not. |
GraphPlotter<T,U> |
plotter()
Gets an instance of a plotter for this Cayley graph
|
void |
setLabelFormatter(CayleyGraph.LabelFormatter<U> formatter) |
void |
setLabelling(CayleyVertexLabelling<U> l)
Sets the labelling associated to the vertices of the graph
|
java.lang.String |
toString() |
add, addAll, getDepth, getEdgeCount, getEdges, getInitialVertex, getVertex, getVertexCount, getVertexLabels, getVertexWithId, getVertices, setInitialVertexIdpublic CayleyGraph()
public CayleyGraph(CayleyGraph<T,U> graph)
graph - The graph to copypublic void setLabelFormatter(CayleyGraph.LabelFormatter<U> formatter)
public float[][] getAdjacencyMatrix()
getAdjacencyMatrix in class LabelledGraph<T extends Event>protected Vertex<T> getFirstVertexWithLabelling(MathSet<U> eq_class)
eq_class - The equivalence classpublic GraphPlotter<T,U> plotter()
public void setLabelling(CayleyVertexLabelling<U> l)
l - The labellingpublic CayleyVertexLabelling<U> getLabelling()
public java.util.Map<MathSet<U>,java.lang.Integer> getClassCardinality(int length, boolean cumulative)
length - The lengthcumulative - If set to true, will compute the number of traces
of length at most length (instead of exactly of length
length)public boolean isIsomorphicTo(CayleyGraph<T,U> other_graph)
This method is not used for test case generation, but is useful to perform unit tests to check the output of various graph solvers.
other_graph - The other graphpublic boolean isIsomorphicToThrowable(CayleyGraph<T,U> other_graph) throws CayleyGraph.IsomorphismException
isIsomorphicTo(CayleyGraph) but throws an exception
explaining why the graphs are not isomorphic when they are not.other_graph - The other graphCayleyGraph.IsomorphismExceptionprotected boolean checkMapping(int current_node_id,
CayleyGraph<T,U> other_graph,
int other_node_id,
java.util.Map<java.lang.Integer,java.lang.Integer> mapping)
throws CayleyGraph.IsomorphismException
CayleyGraph.IsomorphismExceptionprotected Edge<T> getEdgeWithDestinationId(java.util.Set<Edge<T>> edges, T label, int id)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Map<java.lang.Integer,java.util.Set<MathSet<U>>> getClassesByDepth()
protected void getClassesByDepth(java.util.Map<java.lang.Integer,java.util.Set<MathSet<U>>> map, java.util.Map<MathSet<U>,java.lang.Integer> visited, java.util.Set<java.lang.Integer> visited_ids, Vertex<T> node, int cur_depth, int max_depth)
map - visited - visited_ids - node - cur_depth - max_depth - Copyright © Sylvain HallĂ©. All Rights Reserved.