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

## edu.uci.ics.jung.algorithms.blockmodel
Class EquivalenceRelation

    java.lang.Object
      edu.uci.ics.jung.algorithms.blockmodel.EquivalenceRelation

public class EquivalenceRelation
extends Object

An EquivalenceRelation holds a number of Equivalent vertices from the same graph. created Feb 3, 2004

Author:
  danyelf

Constructor Summary
`EquivalenceRelation(Set rv, Graph g)` Input is the basic data structure underneath: a Set of Sets.

Method Summary
`Iterator` | `getAllEquivalences()` Iterates through all the equivalence sets.
`Set` | `getEquivalenceRelationContaining(Vertex v)` Returns the part of the relation that contains this vertex: it is, of course, a Set If the vertex does not belong to any relation, null is returned.
`Graph` | `getGraph()` Returns the common graph to which all the vertices belong
`Set` | `getSingletonVertices()` Returns the set of vertices that do not belong to an particular equivalence class.
`int` | `numRelations()` Returns the number of relations defined.
`String` | `toString()`

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

Constructor Detail

### EquivalenceRelation

    public EquivalenceRelation(Set rv,
                               Graph g)

  Input is the basic data structure underneath: a Set of Sets. The sets must be mutually exclusive, non-empty, and contain only vertices from the graph. A reference to the underlying sets is maintained; be careful not to accidently modify them after the ER is created.

Method Detail

### getGraph

    public Graph getGraph()

  Returns the common graph to which all the vertices belong

### getSingletonVertices

    public Set getSingletonVertices()

  Returns the set of vertices that do not belong to an particular equivalence class. Takes O(n) time by walking through the whole graph and checking all vertices that are not in any equivalence relation.

### getAllEquivalences

    public Iterator getAllEquivalences()

  Iterates through all the equivalence sets. Does not return any singletons.

  Returns:
    an Iterator of Sets of vertices.

### getEquivalenceRelationContaining

    public Set getEquivalenceRelationContaining(Vertex v)

  Returns the part of the relation that contains this vertex: it is, of course, a Set If the vertex does not belong to any relation, null is returned.

### numRelations

    public int numRelations()

  Returns the number of relations defined.

### toString

    public String toString()

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