signature.edgecolored.EdgeColoredGraphSignature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signatures Show documentation
Show all versions of signatures Show documentation
A graph signature library
The newest version!
package signature.edgecolored;
import java.util.Map;
import signature.AbstractGraphSignature;
import signature.AbstractVertexSignature;
/**
* A test implementation of signatures for {@link EdgeColoredGraph}s.
*
* @author maclean
*
*/
public class EdgeColoredGraphSignature extends AbstractGraphSignature {
public EdgeColoredGraph graph;
private Map colorMap;
public EdgeColoredGraphSignature(EdgeColoredGraph graph, Map colorMap) {
super();
this.graph = graph;
this.colorMap = colorMap;
}
public int getVertexCount() {
return this.graph.getVertexCount();
}
@Override
public String signatureStringForVertex(int vertexIndex) {
EdgeColoredVertexSignature vertexSignature;
int height = super.getHeight();
if (height == -1) {
vertexSignature =
new EdgeColoredVertexSignature(vertexIndex, this.graph, this.colorMap);
} else {
vertexSignature =
new EdgeColoredVertexSignature(vertexIndex, height, this.graph, this.colorMap);
}
return vertexSignature.toCanonicalString();
}
@Override
public String signatureStringForVertex(int vertexIndex, int height) {
EdgeColoredVertexSignature vertexSignature =
new EdgeColoredVertexSignature(vertexIndex, height, this.graph, this.colorMap);
return vertexSignature.toCanonicalString();
}
public String toCanonicalString() {
return super.toCanonicalString();
}
@Override
public AbstractVertexSignature signatureForVertex(int vertexIndex) {
return new EdgeColoredVertexSignature(vertexIndex, this.graph, this.colorMap);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy