next up previous contents index
Next: Graph Generators ( generators Up: Graphs and Generators Previous: Clusters ( Cluster )   Contents   Index


Cluster Graphs ( ClusterGraph )

Baseclasses


\begin{picture}(6.5,2.5)
\thicklines
\put(0,1.5){\framebox (5,1){\bf graph}}...
...\vector(0,-1){1}}\put(1.5,0){\framebox (5,1){\bf ClusterGraph}}
\end{picture}

Definition

An instance CG of type ClusterGraph suplies additional functions to the LEDA graph class for the creation of a hierarchical cluster structure. The root of this hierarchy is called rootcluster. Below in the hierarchy, clusters can be nested inside other clusters. Clusters can also contain nodes. Each node can only be a member of one cluster. By default, nodes are created as members of the rootcluster unless other specified.

#include < AGD/ClusterGraph.h >

Creation

ClusterGraph CG creates an instance CG of type ClusterGraph initialized to an empty graph with an empty cluster hierarchy.

Operations

Cluster* CG.get_rootcluster(void) returns the rootcluster of the cluster hierarchy.

leda_list<Cluster *> CG.all_clusters() returns the list of all clusters in CG.

leda_list<Cluster*> CG.all_subcluster(Cluster* cl)
    returns a list of all subcluster of T(c).

bool CG.is_member(Cluster* cl, leda_node v)
    returns true if node v is a member of a subcluster of cl, otherwise false.

Cluster* CG.new_cluster(void) creates a new empty cluster c as a child of the rootcluster and returns c.

Cluster* CG.new_cluster(Cluster* cl)
    creates a new empty cluster c as a child of the existing cluster cl and returns c.

leda_node CG.new_node(Cluster* cl) creates a new node v and make it a member of cluster cl.

Cluster* CG.cluster_of(leda_node v)
    returns the cluster c where v belongs too.

void CG.clear_clustertree(void)
    removes all clusters from the cluster hierarchy. All nodes of CG are made members of the rootcluster.

void CG.move_node(Cluster* cl, leda_node v)
    makes an existing node v a new member of cluster cl and deletes it from its previous cluster.

Implementation

All operations for graphs are available for instances of type ClusterGraph, too. clear_clustertree() takes time $ \protectO$(c) where c is the number of clusters in the cluster hierarchy. All other operations take constant time.


next up previous contents index
Next: Graph Generators ( generators Up: Graphs and Generators Previous: Clusters ( Cluster )   Contents   Index

© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13