public class ProcessGraph
extends java.lang.Object
Constructor and Description |
---|
ProcessGraph() |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.util.ArrayList<Edge>> |
allNodeSubsets(Node node)
Receieves a node which includes its edges
and finds ALL possible ways to combine the edges
i.e if we have node 'A' with edges 1,2,3
it will return 1,2,3,1 2, 1 3, 2 3, 1 2 3
|
boolean |
areDisconnected(Node homeNode,
Node destNode)
Tests if there is a way to traverse edges so that we reach node2 from node1
|
boolean |
areDisconnected2(Node homeNode,
Node destNode)
Tests if there is a way to traverse edges so that we reach node2 from node1
|
int |
clusterSize(Node homeNode)
Counts the number of nodes reachable from the input node
by traversing the nodes edges
|
int |
clusterSize2(Node homeNode)
Counts the number of nodes reachable from the input node
by traversing the nodes edges
|
java.util.ArrayList<Edge> |
copyList(java.util.ArrayList<Edge> list)
Recieves an arraylist and produces a new copy of it
|
java.util.ArrayList<Node> |
copyNodeList(java.util.ArrayList<Node> list)
Recieves an arraylist and produces a new copy of it
|
java.util.ArrayList<EdgeList> |
findMinCuts(java.util.ArrayList<Node> tables)
Identifies the sets of edges that represent min cuts in the diagram
PSEUDOCODE:
Iterate over all nodes
Find all edge combinations for each node
For each combination:
Remove these edges from the graph
Ensure all subset nodes are in the SAME cluster
Test for a relation between the original node and the nodes in the subset
Ensure that the cluster meets various conditions
Restore the edges
|
java.util.ArrayList<Node> |
getCluster(Node homeNode)
Returns all the nodes reachable from this node
by traversing the nodes edges
|
java.util.ArrayList<Node> |
getCluster2(Node homeNode,
java.util.ArrayList<Node> cluster)
Returns all the nodes reachable from this node
by traversing the nodes edges
|
boolean |
hasAdditionalCuts(Node homeNode,
java.util.ArrayList<EdgeList> mincuts,
EdgeList thisCut)
Checks if there are additional cuts reachable from this node
by traversing the nodes edges
|
boolean |
hasAdditionalCuts2(Node homeNode,
java.util.ArrayList<EdgeList> mincuts,
EdgeList thisCut)
Checks if there are additional cuts reachable from this node
by traversing the nodes edges
|
boolean |
isInMinCuts(Edge edge,
java.util.ArrayList<EdgeList> mincuts,
EdgeList thisCut)
Checks if a given edge is contained in the list of mincuts.
|
boolean |
isMincut(java.util.ArrayList<EdgeList> minCuts,
java.util.ArrayList<Edge> mincut,
Node node)
Verifies that the candidate mincut satisfies the conditions that make it a mincut
Improvement is left for future works
param minCuts The current list of approved minCuts
param mincut The candidate mincut
param node The node we are testing to see if it has a mincut
|
boolean |
processCluster(java.util.ArrayList<Node> cluster)
Uses wordNet to evaluate if a cluster has sufficient inter-similiarity
|
java.util.ArrayList<java.util.ArrayList<Node>> |
processCuts(java.util.ArrayList<Node> cluster,
java.util.ArrayList<java.util.ArrayList<Node>> clusters)
Process the mincuts and combine them in various ways
to find the clusters in the diagram.
|
boolean |
removeEdge(Edge compareEdge,
java.util.ArrayList<Edge> edgeList)
Attempts to remove an edge from an edgeList
|
void |
removeEdgeFromMincuts(java.util.ArrayList<EdgeList> cuts,
EdgeList cut,
java.util.ArrayList<EdgeList> edgesToBeRemoved)
Removes an edge that has already been processed from all other mincuts
|
java.util.ArrayList<java.util.ArrayList<Node>> |
runSystem() |
public java.util.ArrayList<java.util.ArrayList<Edge>> allNodeSubsets(Node node)
node
- THe node for which we want to find the subsetspublic java.util.ArrayList<Edge> copyList(java.util.ArrayList<Edge> list)
list
- An ArrayList of edges that we wish to copypublic java.util.ArrayList<Node> copyNodeList(java.util.ArrayList<Node> list)
list
- An ArrayList of edges that we wish to copypublic boolean areDisconnected(Node homeNode, Node destNode)
homeNode
- The originating node to test fromdestNode
- the destination node we want to see if we can reachpublic boolean areDisconnected2(Node homeNode, Node destNode)
homeNode
- The originating node to test fromdestNode
- the destination node we want to see if we can reachpublic int clusterSize(Node homeNode)
homeNode
- The originating node to test frompublic int clusterSize2(Node homeNode)
homeNode
- The originating node to test frompublic java.util.ArrayList<Node> getCluster(Node homeNode)
homeNode
- The originating node to test frompublic java.util.ArrayList<Node> getCluster2(Node homeNode, java.util.ArrayList<Node> cluster)
homeNode
- The originating node to test frompublic java.util.ArrayList<EdgeList> findMinCuts(java.util.ArrayList<Node> tables)
public boolean isMincut(java.util.ArrayList<EdgeList> minCuts, java.util.ArrayList<Edge> mincut, Node node)
public java.util.ArrayList<java.util.ArrayList<Node>> processCuts(java.util.ArrayList<Node> cluster, java.util.ArrayList<java.util.ArrayList<Node>> clusters)
public java.util.ArrayList<java.util.ArrayList<Node>> runSystem()
public boolean processCluster(java.util.ArrayList<Node> cluster)
cluster
- A group of nodes we wish to evaluatepublic void removeEdgeFromMincuts(java.util.ArrayList<EdgeList> cuts, EdgeList cut, java.util.ArrayList<EdgeList> edgesToBeRemoved)
cuts
- The list of mincutscut
- The cut we are currently processingedgesToBeRemoved
- Store the EdgeLists so we can remove them laterpublic boolean removeEdge(Edge compareEdge, java.util.ArrayList<Edge> edgeList)
compareEdge
- The edge we are trying to removeedgeList
- the list we are trying to remove the edge frompublic boolean hasAdditionalCuts(Node homeNode, java.util.ArrayList<EdgeList> mincuts, EdgeList thisCut)
homeNode
- The originating node to test frommincuts
- The list of mincutsthisCut
- The cut we are currently processing (ignore it)public boolean hasAdditionalCuts2(Node homeNode, java.util.ArrayList<EdgeList> mincuts, EdgeList thisCut)
homeNode
- The originating node to test frommincuts
- The list of mincutsthisCut
- The cut we are currently processing (ignore it)public boolean isInMinCuts(Edge edge, java.util.ArrayList<EdgeList> mincuts, EdgeList thisCut)
edge
- The edge to test onmincuts
- The list of mincutsthisCut
- The cut we are currently processing (ignore it)