helix.graph.algo.c3part.compressor
Interface GraphCompressor

All Known Subinterfaces:
MultiGraphCompressor
All Known Implementing Classes:
AbstractCompressor, AbstractMultiCompressor, MultiIdentCompressor, MultiInColorsCompressor, MultiInSetColorsCompressor, MultiInSetCompressor, NoCompressor

public interface GraphCompressor

A graph compressor is used to compress vertices and edges of graphs.
It is based on a compression condition that is expressed by a subsumption relation S between vertices.
v S u => u can be removed from graph, u is stored in Alias(v), v is stored as Root(u). (note that S is either a partial order or an equivalence relation) The storage allows for further expansion of the graph to its initial state.


Method Summary
 void compress(Graph graph)
          compress graph
 void compress(Graph graph, Logger logger)
          same as compress with logging compression rate
 void compressVertex(Vertex v, Vertex root, Graph graph)
          compress single vertex v on root vertex
 void expand(Graph graph)
          expand graph to its uncompressed (initial) state
 void expandVertex(Vertex v, Graph graph)
          restore compressed alias vertex v to its initial state
 void flatten(Graph graph)
          expand graph without edges AV TODO temporary placeholder
 Iterable<Vertex> getAliases(Vertex v)
          get aliases of root vertex return empty set if v is not root
 Iterable<Vertex> getNeighbors(Vertex v)
          return neighbors of vertex v, including aliases of neighbors
 String getParamInfo()
          get optional parameters info
 Vertex getRoot(Vertex v)
          get root of a compressed vertex
 Iterable<Vertex> getVertices(Graph graph)
          return all vertices in compressed graph.
 boolean isAlias(Vertex v)
          tell if vertex is an Alias vertex.
 boolean isNormal(Vertex v)
          tell if vertex is a normal vertex.
 boolean isRoot(Vertex v)
          tell if vertex is a root vertex.
 int nbVertices(Graph graph)
          return the number of vertices in graph (including compressed one)
 GSet<Vertex> retrieveSet()
          retrieve previously stored set this is an optional operation
 void storeSet(GSet<Vertex> set)
          temporarily stores a set of vertices this is an optional operation
 boolean subsumes(Vertex v, Vertex u, Graph graph)
          tells if vertex v subsumes vertex u
 

Method Detail

subsumes

boolean subsumes(Vertex v,
                 Vertex u,
                 Graph graph)
tells if vertex v subsumes vertex u


compressVertex

void compressVertex(Vertex v,
                    Vertex root,
                    Graph graph)
compress single vertex v on root vertex


compress

void compress(Graph graph)
compress graph


compress

void compress(Graph graph,
              Logger logger)
same as compress with logging compression rate


expandVertex

void expandVertex(Vertex v,
                  Graph graph)
                  throws NotExpandableVertexException
restore compressed alias vertex v to its initial state

Throws:
NotExpandableVertexException

expand

void expand(Graph graph)
expand graph to its uncompressed (initial) state


getVertices

Iterable<Vertex> getVertices(Graph graph)
return all vertices in compressed graph. for efficiency, vertices should be returned in an ordered way : any root vertex should be immediately followed by it aliases.


nbVertices

int nbVertices(Graph graph)
return the number of vertices in graph (including compressed one)


getNeighbors

Iterable<Vertex> getNeighbors(Vertex v)
return neighbors of vertex v, including aliases of neighbors


isAlias

boolean isAlias(Vertex v)
tell if vertex is an Alias vertex.


isRoot

boolean isRoot(Vertex v)
tell if vertex is a root vertex. i.e. if it owns at least one alias


isNormal

boolean isNormal(Vertex v)
tell if vertex is a normal vertex. i.e. neither root nor alias


getRoot

Vertex getRoot(Vertex v)
get root of a compressed vertex


getAliases

Iterable<Vertex> getAliases(Vertex v)
get aliases of root vertex return empty set if v is not root


flatten

void flatten(Graph graph)
expand graph without edges AV TODO temporary placeholder


storeSet

void storeSet(GSet<Vertex> set)
temporarily stores a set of vertices this is an optional operation


retrieveSet

GSet<Vertex> retrieveSet()
retrieve previously stored set this is an optional operation


getParamInfo

String getParamInfo()
get optional parameters info