|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsalvo.jesus.graph.GraphImpl
salvo.jesus.graph.WeightedGraphImpl
gr.demokritos.iit.jinsect.structs.UniqueVertexGraph
gr.demokritos.iit.conceptualIndex.documentModel.SymbolicGraph
public class SymbolicGraph
Represents a graph of symbols of different character lengths. Each symbol is connected to any symbols of smaller size that compose it. Symbols of higher size (also called rank) are considered to be offspring of lower rank symbols that compose the former.
Field Summary | |
---|---|
protected java.util.Set |
Alphabet
The alphabet of symbols (characters) contained in the data string |
protected java.lang.String |
DataString
The datastring corresponding to the loaded data |
Fields inherited from class gr.demokritos.iit.jinsect.structs.UniqueVertexGraph |
---|
UniqueVertices |
Fields inherited from class salvo.jesus.graph.GraphImpl |
---|
factory, traversal |
Constructor Summary | |
---|---|
SymbolicGraph(int iMinNGramSize,
int iMaxNGramSize)
Creates a new instance of SymbolicGraph given a range of n-gram ranks (lengths). |
Method Summary | |
---|---|
salvo.jesus.graph.Edge |
addEdge(salvo.jesus.graph.Vertex vHead,
salvo.jesus.graph.Vertex vTail)
Adds an edge to the graph, if the former does not already exist in the graph. |
java.util.Set |
getAlphabet()
Returns the set of characters contained in the data string of the graph. |
salvo.jesus.graph.Vertex |
getCommonSubnode(java.util.List lNodes)
Returns a vertex of higher rank (that is to say length), that is composed by at least the vertices appearing in a given list. |
java.lang.String |
getDataString()
Returns the data string corresponding to the SymbolicGraph. |
java.util.List |
getLinkBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo)
Calculates the link (i.e. |
java.util.List |
getLinkBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo,
java.util.Map mAlreadyVisited)
Calculates the link (i.e. |
NotificationListener |
getNotificationListener()
|
java.util.List |
getPathBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo)
Calculates the path between two vertices in this graph. |
java.util.List |
getPathBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo,
java.util.Map mAlreadyVisited)
Calculates the path between two vertices in this graph, given a list of already visited vertices, that should not be traversed again. |
double |
getPathLength(java.util.List lPath)
Calculates the total distance over a graph path, only taking into account edge count. |
double |
getPathWeight(java.util.List lPath)
Calculates the total path weight over a graph path. |
java.util.List |
getShortestLinkBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo)
Calculates the minimum distance path (i.e. |
java.util.List |
getShortestLinkBetween(salvo.jesus.graph.Vertex vFrom,
salvo.jesus.graph.Vertex vTo,
java.util.Map mAlreadyVisited)
Calculates the shortest link (i.e. |
void |
loadFromFile(java.lang.String sFilename)
Augments this graph based on a given file. |
static void |
main(java.lang.String[] sArgs)
Helper function. |
void |
removeNotificationListener()
|
void |
setDataString(java.lang.String sDataString)
Augments this graph given a string. |
void |
setNotificationListener(NotificationListener nlListener)
|
Methods inherited from class gr.demokritos.iit.jinsect.structs.UniqueVertexGraph |
---|
add, addEdge, contains, locateVertex |
Methods inherited from class salvo.jesus.graph.WeightedGraphImpl |
---|
addEdge, getClosest, minimumSpanningTree, setMinimumSpanningTreeAlgorithm, setShortestPathAlgorithm, shortestPath |
Methods inherited from class salvo.jesus.graph.GraphImpl |
---|
addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, containsEdge, containsVertex, forgetConnectedSets, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, toString, traverse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface salvo.jesus.graph.Graph |
---|
addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverse |
Field Detail |
---|
protected java.lang.String DataString
protected java.util.Set Alphabet
Constructor Detail |
---|
public SymbolicGraph(int iMinNGramSize, int iMaxNGramSize)
iMinNGramSize
- The minimum n-gram size within this graph.iMaxNGramSize
- The maximum n-gram size within this graph.Method Detail |
---|
public java.util.List getPathBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo)
vFrom
- The starting vertex.vTo
- The destination vertex.
null
.public java.util.List getPathBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo, java.util.Map mAlreadyVisited)
vFrom
- The starting vertex.vTo
- The destination vertex.mAlreadyVisited
- A map of already visited vertices, where every visited vertex
is mapped to a value of 1.
null
.public java.util.List getShortestLinkBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo)
vFrom
- The starting vertex.vTo
- The destination vertex.
null
.public java.util.List getShortestLinkBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo, java.util.Map mAlreadyVisited)
vFrom
- The starting vertex.vTo
- The destination vertex.mAlreadyVisited
- A map of already visited vertices, where every visited vertex
is mapped to a value of 1.
null
.public java.util.List getLinkBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo)
vFrom
- The starting vertex.vTo
- The destination vertex.
null
.public java.util.List getLinkBetween(salvo.jesus.graph.Vertex vFrom, salvo.jesus.graph.Vertex vTo, java.util.Map mAlreadyVisited)
vFrom
- The starting vertex.vTo
- The destination vertex.mAlreadyVisited
- A map of already visited vertices, where every visited vertex
is mapped to a value of 1.
null
.public double getPathWeight(java.util.List lPath)
lPath
- The list of edges indicating the path to follow.
public final double getPathLength(java.util.List lPath)
lPath
- The list of edges indicating the path to follow.
public salvo.jesus.graph.Vertex getCommonSubnode(java.util.List lNodes)
lNodes
- The list of vertices (or nodes) that should be ancestors of the higher rank
vertex.
null
is returned.public void loadFromFile(java.lang.String sFilename)
sFilename
- The filename of the file to load.public void setDataString(java.lang.String sDataString)
sDataString
- The string used to extract n-grams.public java.lang.String getDataString()
public java.util.Set getAlphabet()
Set
containing the unique characters in the data string.public salvo.jesus.graph.Edge addEdge(salvo.jesus.graph.Vertex vHead, salvo.jesus.graph.Vertex vTail) throws java.lang.Exception
addEdge
in interface salvo.jesus.graph.Graph
addEdge
in class UniqueVertexGraph
vHead
- The head vertex of the edge.vTail
- The tail vertex of the edge.
java.lang.Exception
- If the edge cannot be added.public void setNotificationListener(NotificationListener nlListener)
setNotificationListener
in interface Notifier
public void removeNotificationListener()
removeNotificationListener
in interface Notifier
public NotificationListener getNotificationListener()
getNotificationListener
in interface Notifier
public static void main(java.lang.String[] sArgs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |