edu.mit.csail.sdg.squander.examples.graph.Graph Class Reference
[Examples]

Inherits java::io::Serializable.

Collaboration diagram for edu.mit.csail.sdg.squander.examples.graph.Graph:
Collaboration graph
[legend]

List of all members.

Classes

class  Edge
class  Node

Public Member Functions

Node getAuxNode ()
void setAuxNode (Node aux)
int getAuxInt ()
void setAuxInt (int auxInt)
 Graph ()
Node newNode (int key)
void addNode (Node n)
void addEdge (Edge e)
void newUndirectedEdge (Node a, Node b)
void newUndirectedEdge (Node a, Node b, int cost)
Edge newEdge (Node a, Node b)
Edge newEdge (Node a, Node b, int cost)
boolean containsEdge (Node n1, Node n2)
Node findNode (int label)
Node[] nodes ()
Edge[] edges ()
int numEdges ()
int numNodes ()
int size ()
Set< Node > getNeighbors (Node src)
void removeAllIncomingEdges (Node n)
void removeAllOutgoingEdges (Node n)
Node[] hamiltonian ()
Edge[] hamiltonian2 ()
Edge[] tsp (Node startNode, int maxCost)
Node[] topsort ()
Node[] maxClique (int k)
Map< Node, Integer > color (int k)
String toString ()

Static Public Member Functions

static boolean checkTSP (Graph g, Edge[] hamcycle, int maxCost)

Private Attributes

Set< Node > nodes = new LinkedHashSet<Node>()
Set< Edge > edges = new LinkedHashSet<Edge>()
Node auxNode
int auxInt

Static Private Attributes

static final long serialVersionUID = -6332798241722968023L

Detailed Description

An implementation of the Graph data structure, along with several graph algorithms.

Author:
Aleksandar Milicevic

Definition at line 28 of file Graph.java.


Constructor & Destructor Documentation

edu.mit.csail.sdg.squander.examples.graph.Graph.Graph (  ) 

Definition at line 145 of file Graph.java.


Member Function Documentation

void edu.mit.csail.sdg.squander.examples.graph.Graph.addEdge ( Edge  e  ) 
void edu.mit.csail.sdg.squander.examples.graph.Graph.addNode ( Node  n  ) 
static boolean edu.mit.csail.sdg.squander.examples.graph.Graph.checkTSP ( Graph  g,
Edge[]  hamcycle,
int  maxCost 
) [static]

Definition at line 318 of file Graph.java.

References edu.mit.csail.sdg.squander.examples.graph.Graph.nodes.

Map<Node, Integer> edu.mit.csail.sdg.squander.examples.graph.Graph.color ( int  k  ) 

Graph k-Coloring problem

Definition at line 303 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testColor().

boolean edu.mit.csail.sdg.squander.examples.graph.Graph.containsEdge ( Node  n1,
Node  n2 
)
Node edu.mit.csail.sdg.squander.examples.graph.Graph.findNode ( int  label  ) 
int edu.mit.csail.sdg.squander.examples.graph.Graph.getAuxInt (  ) 
Node edu.mit.csail.sdg.squander.examples.graph.Graph.getAuxNode (  ) 
Set<Node> edu.mit.csail.sdg.squander.examples.graph.Graph.getNeighbors ( Node  src  ) 
Node [] edu.mit.csail.sdg.squander.examples.graph.Graph.hamiltonian (  ) 

Spec for the Hamiltonian path problem

Definition at line 226 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testGraph1().

Edge [] edu.mit.csail.sdg.squander.examples.graph.Graph.hamiltonian2 (  ) 

A different spec for the Hamiltonian path problem

Definition at line 242 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testGraph1().

Node [] edu.mit.csail.sdg.squander.examples.graph.Graph.maxClique ( int  k  ) 

Max Clique

Definition at line 288 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testGraph2().

Edge edu.mit.csail.sdg.squander.examples.graph.Graph.newEdge ( Node  a,
Node  b,
int  cost 
)
Edge edu.mit.csail.sdg.squander.examples.graph.Graph.newEdge ( Node  a,
Node  b 
)
Node edu.mit.csail.sdg.squander.examples.graph.Graph.newNode ( int  key  ) 
void edu.mit.csail.sdg.squander.examples.graph.Graph.newUndirectedEdge ( Node  a,
Node  b,
int  cost 
)
void edu.mit.csail.sdg.squander.examples.graph.Graph.newUndirectedEdge ( Node  a,
Node  b 
)
int edu.mit.csail.sdg.squander.examples.graph.Graph.numEdges (  ) 
int edu.mit.csail.sdg.squander.examples.graph.Graph.numNodes (  ) 
void edu.mit.csail.sdg.squander.examples.graph.Graph.removeAllIncomingEdges ( Node  n  ) 
void edu.mit.csail.sdg.squander.examples.graph.Graph.removeAllOutgoingEdges ( Node  n  ) 
void edu.mit.csail.sdg.squander.examples.graph.Graph.setAuxInt ( int  auxInt  ) 

Definition at line 143 of file Graph.java.

void edu.mit.csail.sdg.squander.examples.graph.Graph.setAuxNode ( Node  aux  ) 
int edu.mit.csail.sdg.squander.examples.graph.Graph.size (  ) 
Node [] edu.mit.csail.sdg.squander.examples.graph.Graph.topsort (  ) 

Topological sort

Definition at line 274 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testGraph1().

String edu.mit.csail.sdg.squander.examples.graph.Graph.toString (  ) 

Definition at line 308 of file Graph.java.

Edge [] edu.mit.csail.sdg.squander.examples.graph.Graph.tsp ( Node  startNode,
int  maxCost 
)

Traveling Salesman Problem

Definition at line 260 of file Graph.java.

Referenced by edu.mit.csail.sdg.squander.examples.graph.GraphTest.testTSP().


Member Data Documentation

Set<Edge> edu.mit.csail.sdg.squander.examples.graph.Graph.edges = new LinkedHashSet<Edge>() [private]
Set<Node> edu.mit.csail.sdg.squander.examples.graph.Graph.nodes = new LinkedHashSet<Node>() [private]
final long edu.mit.csail.sdg.squander.examples.graph.Graph.serialVersionUID = -6332798241722968023L [static, private]

Definition at line 30 of file Graph.java.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208