edu.mit.sketch.chem.graph
Class Graph

java.lang.Object
  extended by edu.mit.sketch.chem.graph.Graph

public class Graph
extends java.lang.Object


Field Summary
 java.util.List<GraphEdge> edges
           
 java.util.Queue<GraphVertex> queue
           
 java.util.List<GraphVertex> vertices
           
 
Constructor Summary
Graph()
           
 
Method Summary
 void addEdge(SketchComponent source)
          Add an edge (bond) to the connectedness graph
 void addEdge(SketchComponent source, GraphVertex v1, GraphVertex v2)
          Add a connected edge (bond) to the connectedness graph
 void addVertex(GraphVertex v)
          Add a vertex (element or compound) to the connectedness graph
 java.util.List<StrokeGroup> causes(GraphVertex v)
           
 void connectGraph(double threshold, double bondLength)
           
 void connectSpatial(double threshold)
           
 boolean connectValence(double threshold)
           
 boolean connectValenceImplicit(double threshold)
           
 void createBenzene(java.util.List<GraphVertex> cycle)
           
 java.util.List<GraphVertex> depthFirstSearch(GraphVertex target, GraphVertex cur, java.util.List<GraphVertex> history, int mindepth, int maxdepth)
           
 java.util.List<GraphVertex> findCycle(GraphVertex v, int maxdepth)
           
 java.util.List<GraphVertex> findProblems()
           
 void identifyBenzeneRings(double bondLength)
          Find Benzene Rings
 void mergeVertices(GraphVertex v1, GraphVertex v2)
           
 void paint(java.awt.Graphics g)
          Paint the connectedness graph
 void printGraph(java.lang.String filename)
           
 double prob()
           
 java.util.List<GraphVertex> refineCycle(java.util.List<GraphVertex> cycle)
           
 void removeEdge(GraphEdge e)
           
 void removeVertex(GraphVertex v)
           
 void updateID()
           
 void updateValence(boolean updateRecognition)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

public java.util.List<GraphVertex> vertices

edges

public java.util.List<GraphEdge> edges

queue

public java.util.Queue<GraphVertex> queue
Constructor Detail

Graph

public Graph()
Method Detail

paint

public void paint(java.awt.Graphics g)
Paint the connectedness graph


addVertex

public void addVertex(GraphVertex v)
Add a vertex (element or compound) to the connectedness graph


addEdge

public void addEdge(SketchComponent source)
Add an edge (bond) to the connectedness graph


addEdge

public void addEdge(SketchComponent source,
                    GraphVertex v1,
                    GraphVertex v2)
Add a connected edge (bond) to the connectedness graph


removeVertex

public void removeVertex(GraphVertex v)

removeEdge

public void removeEdge(GraphEdge e)

connectGraph

public void connectGraph(double threshold,
                         double bondLength)

connectValence

public boolean connectValence(double threshold)

connectValenceImplicit

public boolean connectValenceImplicit(double threshold)

prob

public double prob()

connectSpatial

public void connectSpatial(double threshold)

updateValence

public void updateValence(boolean updateRecognition)

findProblems

public java.util.List<GraphVertex> findProblems()

causes

public java.util.List<StrokeGroup> causes(GraphVertex v)

mergeVertices

public void mergeVertices(GraphVertex v1,
                          GraphVertex v2)

updateID

public void updateID()

identifyBenzeneRings

public void identifyBenzeneRings(double bondLength)
Find Benzene Rings


createBenzene

public void createBenzene(java.util.List<GraphVertex> cycle)

findCycle

public java.util.List<GraphVertex> findCycle(GraphVertex v,
                                             int maxdepth)

depthFirstSearch

public java.util.List<GraphVertex> depthFirstSearch(GraphVertex target,
                                                    GraphVertex cur,
                                                    java.util.List<GraphVertex> history,
                                                    int mindepth,
                                                    int maxdepth)

refineCycle

public java.util.List<GraphVertex> refineCycle(java.util.List<GraphVertex> cycle)

printGraph

public void printGraph(java.lang.String filename)