Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## dataStructures
Class AdjacencyDigraph

    java.lang.Object
      |
      +--dataStructures.Graph
            |
            +--dataStructures.AdjacencyDigraph

Direct Known Subclasses:
  AdjacencyGraph

public class AdjacencyDigraph
extends Graph

Constructor Summary
`AdjacencyDigraph()`
`AdjacencyDigraph(int theVertices)`

Method Summary
`void` | `bfs(int v, int[] reach, int label)` breadth-first search
`int` | `degree(int i)` this method is undefined for directed graphs
`int` | `edges()`
`boolean` | `existsEdge(int i, int j)`
`int` | `inDegree(int i)`
`java.util.Iterator` | `iterator(int i)` create and return an iterator for vertex i
`static void` | `main(java.lang.String[] args)` test program
`int` | `outDegree(int i)`
`void` | `output()` output the adjacency matrix
`void` | `putEdge(java.lang.Object theEdge)` put edge e into the digraph
`void` | `removeEdge(int i, int j)` remove the edge (i,j)
`int` | `vertices()`

Methods inherited from class dataStructures.Graph
`bellmanFord, bipartiteCover, connected, dfs, findPath, kruskal, labelComponents, topologicalOrder, verifyDirected, verifyUndirected, verifyWeighted, verifyWeightedUndirected`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdjacencyDigraph

    public AdjacencyDigraph(int theVertices)

### AdjacencyDigraph

    public AdjacencyDigraph()

Method Detail

### vertices

    public int vertices()

  Returns:
    number of vertices
  Overrides:
    vertices in class Graph

### edges

    public int edges()

  Returns:
    number of edges
  Overrides:
    edges in class Graph

### existsEdge

    public boolean existsEdge(int i,
                              int j)

  Returns:
    true iff (i,j) is an edge
  Overrides:
    existsEdge in class Graph

### putEdge

    public void putEdge(java.lang.Object theEdge)

  put edge e into the digraph
  Throws:
    IllegalArgumentExceptin - when theEdge is invalid
  Overrides:
    putEdge in class Graph

### removeEdge

    public void removeEdge(int i,
                           int j)

  remove the edge (i,j)
  Overrides:
    removeEdge in class Graph

### degree

    public int degree(int i)

  this method is undefined for directed graphs
  Overrides:
    degree in class Graph

### outDegree

    public int outDegree(int i)

  Returns:
    out-degree of vertex i
  Throws:
    java.lang.IllegalArgumentException - when i is an invalid vertex
  Overrides:
    outDegree in class Graph

### inDegree

    public int inDegree(int i)

  Returns:
    in-degree of vertex i
  Throws:
    java.lang.IllegalArgumentException - when i is an invalid vertex
  Overrides:
    inDegree in class Graph

### output

    public void output()

  output the adjacency matrix

### iterator

    public java.util.Iterator iterator(int i)

  create and return an iterator for vertex i
  Throws:
    java.lang.IllegalArgumentException - when i is an invalid vertex
  Overrides:
    iterator in class Graph

### bfs

    public void bfs(int v,
                    int[] reach,
                    int label)

  breadth-first search
  Overrides:
    bfs in class Graph

### main

    public static void main(java.lang.String[] args)

  test program

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD