An Optimal Graph Theoretic Approach to Data Clustering: Theory and Its Application to Image Segmentation

Zhenyu WuR. Leahy

article1993TPAMI1,331 citations

Develops a scalable graph-theoretic clustering method using subgraph condensation and equivalent trees to find globally optimal minimum cuts, guaranteeing closed boundary contours in image segmentation across hundreds of thousands of vertices.

Listen

Data clustering and image segmentation are critical tools in computational data analysis, computer vision, and medical imaging. Standard clustering algorithms often struggle to find globally optimal partitions without prohibitive computational cost, while conventional edge detection methods either fail to form closed, contiguous boundaries or misplace region contours. The article addresses this challenge by presenting a globally optimal graph-theoretic data clustering framework and demonstrating its practical application to image segmentation.

The primary objective of the article is to establish a network flow-based clustering methodology that minimizes inter-subgraph similarity and to demonstrate an efficient hierarchical implementation capable of scaling to very large datasets, such as full-resolution images. The framework represents data points or image pixels as vertices in an undirected graph connected by arcs weighted by similarity. By leveraging network flow theory and the Gomory-Hu algorithm, partitioning the graph into distinct clusters corresponds to identifying minimum cuts. To overcome the computational bottleneck of running network flow algorithms on graphs with tens or hundreds of thousands of vertices, the authors introduce a hierarchical subgraph condensation technique that prunes unneeded high-capacity cuts using local processing, preserving global optimality while reducing processing time from over 12 hours to roughly 10 minutes.

The article demonstrates several key findings. First, graph partitioning via minimum cuts achieves a globally optimal cluster configuration that minimizes the maximum flow between subgraphs and produces a natural, nested sequence of optimal partitions for varying numbers of clusters. Second, the hierarchical condensation algorithm allows the framework to scale to massive graphs containing several hundred thousand vertices without losing mathematical optimality. Third, when applied to image segmentation—such as magnetic resonance brain scans and aerial photographs—the method reliably finds closed, thin edge contours along true object boundaries while naturally suppressing weak or isolated edges, outperforming traditional zero-crossing operators.

These findings indicate that complex segmentation and clustering tasks can achieve global mathematical optimality within realistic computing constraints. In practical applications like medical imaging, this approach enables more reliable isolation of critical anatomical structures and lesions without manual edge linking or thinning. Next steps supported by the article include integrating domain-specific prior information into the capacity functions and using the segmented regions as inputs to automated tissue labeling algorithms. The main operational constraints involve selecting appropriate edge-mask parameters, capacity functions, and minimum cluster size thresholds to avoid generating small, unclassified boundary fragments.

No sufficiently relevant recommendations were found.

Cover for An Optimal Graph Theoretic Approach to Data Clustering: Theory and Its Application to Image Segmentation

Abstract

A novel graph theoretic approach for data clustering is presented and its application to the image segmentation problem is demonstrated. The data to be clustered are represented by an undirected adjacency graph G with arc capacities assigned to reflect the similarity between the linked vertices. Clustering is achieved by removing arcs of G to form mutually exclusive subgraphs such that the largest inter-subgraph maximum flow is minimized. For graphs of moderate size (~ 2000 vertices), the optimal solution is obtained through partitioning a flow and cut equivalent tree of G, which can be efficiently constructed using the Gomory-Hu algorithm. However for larger graphs this approach is impractical. New theorems for subgraph condensation are derived and are then used to develop a fast algorithm which hierarchically constructs and partitions a partially equivalent tree of much reduced size. This algorithm results in an optimal solution equivalent to that obtained by partitioning the complete equivalent tree and is able to handle very large graphs with several hundred thousand vertices. The new clustering algorithm is applied to the image segmentation problem. The segmentation is achieved by effectively searching for closed contours of edge elements (equivalent to minimum cuts in G), which consist mostly of strong edges, while rejecting contours containing isolated strong edges. This method is able to accurately locate region boundaries and at the same time guarantees the formation of closed edge contours.

Table of Contents

  • I. INTRODUCTION
  • II. FORMULATION
  • A. Review of Network Flow Theory
  • B. Clustering Rationale
  • C. The Clustering Algorithm and Its Properties
  • D. A Clustering Example
  • III. HIERARCHICAL IMPLEMENTATION
  • A. Extensions on Network Flow Theory
  • B. A Clustering Algorithm Using Hierarchical Implementation
  • C. Incorporation of Constraints
  • IV. IMAGE SEGMENTATION BASED ON CLUSTERING
  • V. EXPERIMENTAL RESULTS
  • A. Edge Based Segmentation of a MR Image
  • B. Edge Detection of An Airport Image
  • VI. CONCLUSION
  • REFERENCES

Knowls

  1. Knowl 1 — Optimal K-Subgraph Partitioning via Gomory-Hu Cut Equivalent Trees

    theoretical result

    For an undirected data adjacency graph G=(V,A)G = (V, A) where each vertex represents a data point and each edge (vi,vj)eextnull(v_i, v_j) e ext{null} has a non-negative capacity cijc_{ij} representing similarity, an unconstrained optimal KK-partition of GG into KK mutually exclusive subgraphs that minimizes the maximum inter-subgraph flow is obtained from a Gomory-Hu cut equivalent tree T∗T^* of GG.

    1. Partition Optimality: Removing the K−1K-1 arcs with the smallest capacities from T∗T^* partitions VV into KK connected components such that the maximum inter-subgraph maximum flow between any pair of distinct components is minimized among all possible KK-partitions of GG.
    2. Within-Cluster Dominance: In this optimal partition, the maximum flow between any pair of vertices belonging to the same subgraph (intra-subgraph flow) is strictly greater than or equal to the maximum flow between vertices in distinct subgraphs (inter-subgraph flow).
    3. Uniqueness: If FTF_T is the smallest capacity among all remaining (unmarked) arcs in T∗T^*, and all K−1K-1 removed arcs have capacities strictly less than FTF_T, then this optimal KK-partition is strictly unique.
  2. Knowl 2 — Subgraph Condensation Theorem for Maximum Flow Computation

    theoretical result

    Let G=(V,A)G = (V, A) be an undirected connected graph with positive arc capacities, and let Go=(Vo,Ao)G_o = (V_o, A_o) be an arbitrary subgraph of GG. Let Fo,min⁡′=min⁡u,v∈VoFuv′F'_{o,\min} = \min_{u, v \in V_o} F'_{uv} be the minimum value of maximum flows between all pairs of vertices in VoV_o computed using only the internal edges of subgraph GoG_o. Let GcG_c denote the condensed graph obtained from GG by collapsing all vertices in VoV_o into a single vertex vocv_o^c, summing parallel arc capacities.

    For any two vertices s,t∈Vs, t \in V, if the true maximum flow FstF_{st} in GG satisfies Fst<Fo,min⁡′F_{st} < F'_{o,\min}, then the maximum flow and the minimum cut between ss and tt in GG are identical to those computed between ss and tt in GcG_c. In particular, the minimum cut separating ss and tt in GG cannot contain any internal arc of GoG_o.

  3. Knowl 3 — Partially Flow and Cut Equivalent Tree Construction

    theoretical result

    Let GoG_o be a subgraph of an undirected graph GG, and let Fo,min⁡′=min⁡u,v∈VoFuv′F'_{o,\min} = \min_{u, v \in V_o} F'_{uv} be the minimum maximum flow across all pairs of vertices in GoG_o computed locally within GoG_o. Let GcG_c be formed by condensing all vertices of GoG_o into a single vertex vocv_o^c, and let Tc∗T_c^* be a Gomory-Hu equivalent tree constructed on GcG_c.

    Then Tc∗T_c^* is a partially cut and flow equivalent tree of GG at threshold Fo,min⁡′F'_{o,\min}:

    1. For any pair of vertices s,t∈Vs, t \in V with true maximum flow Fst<Fo,min⁡′F_{st} < F'_{o,\min}, the maximum flow FstF_{st} in GG equals the minimum arc capacity on the unique path between ss and tt in Tc∗T_c^*.
    2. For any pair of vertices s,t∈Vs, t \in V with Fst≥Fo,min⁡′F_{st} \ge F'_{o,\min}, the flow value computed in Tc∗T_c^* is bounded below by Fo,min⁡′F'_{o,\min} (i.e., at least as large as FstF_{st}), ensuring that no arc with capacity below Fo,min⁡′F'_{o,\min} will be incorrectly cut.
  4. Knowl 4 — Interior Branch Condensation of Subgraph Cut Trees

    theoretical result

    Let Go⊂GG_o \subset G be a subgraph of an undirected graph GG. A vertex in GoG_o is an interior vertex if all of its neighboring vertices in GG belong to GoG_o; otherwise it is a boundary vertex. Let To∗T_o^* be a Gomory-Hu equivalent tree constructed on GoG_o.

    Let TobT_o^b be a branch (connected subtree) of To∗T_o^* consisting exclusively of interior vertices of GoG_o, and let Trb∈TobT_r^b \in T_o^b be the root vertex of this branch that connects to a non-interior vertex in To∗T_o^*. Let GcG_c be the graph obtained from GG by condensing all vertices of TobT_o^b into a single vertex vobv_o^b.

    The full equivalent tree T∗T^* of GG can be constructed by:

    1. Constructing an equivalent tree Tc∗T_c^* for the condensed graph GcG_c.
    2. Replacing the condensed vertex vobv_o^b in Tc∗T_c^* with the branch TobT_o^b, connecting TobT_o^b to Tc∗T_c^* through its root vertex TrbT_r^b.

    All minimum cuts inside TobT_o^b are exact minimum cuts in GG and do not need to be recomputed.

  5. Knowl 5 — Hierarchical Clustering Algorithm via Subgraph Condensation

    algorithm

    This algorithm constructs a partially equivalent cut tree Tc∗T_c^* for a large graph G=(V,A)G = (V, A) using multi-level hierarchical condensation and partitions the graph into clusters based on a capacity threshold FTF_T.

    Input: Undirected graph G=(V,A)G = (V, A) with non-negative arc capacities cijc_{ij}, flow threshold FTF_T.
    Output: A set of disjoint subgraphs (clusters) partitioning VV.
    1. Partition GG into small subgraphs of comparable size, denoted by the set {G0,m}\{G_{0,m}\}. Set hierarchy level i←0i \leftarrow 0.
    2. For each subgraph Gi,mG_{i,m}, compute its Gomory-Hu equivalent tree Ti,m∗T_{i,m}^*.
    3. In each tree Ti,m∗T_{i,m}^*:
       a. Permanently condense all subtrees connected by arcs with capacity ≥FT\ge F_T.
       b. Temporarily condense all maximal interior branches to single vertices, yielding condensed subgraphs {Gi,m,c}\{G_{i,m,c}\}.
    4. If {Gi,m,c}\{G_{i,m,c}\} contains only a single condensed subgraph:
       a. Set Tc∗T_c^* to its equivalent tree.
       b. Expand all temporarily condensed interior vertices in Tc∗T_c^*.
       c. Proceed to Step 6.
    5. Else:
       a. Group spatially adjacent condensed subgraphs in {Gi,m,c}\{G_{i,m,c}\} into subsets.
       b. Form new combined subgraphs {Gi+1,m}\{G_{i+1,m}\} by restoring inter-subgraph arcs between the grouped components.
       c. Set i←i+1i \leftarrow i + 1 and return to Step 2.
    6. Remove all arcs in Tc∗T_c^* with capacities <FT< F_T in order of increasing capacity.
    7. Return the resulting connected components of Tc∗T_c^* as the output clusters.
  6. Knowl 6 — Local Edge Strength Computation on Pixel Lattices

    equation

    In a 4-connected 2D image grid where xi,jx_{i,j} denotes the scalar gray-scale intensity at pixel coordinate (i,j)(i, j), edge elements represent boundaries between adjacent pixels. The horizontal edge strength Di,jHD^H_{i,j} between pixel (i,j)(i, j) and (i,j+1)(i, j+1), and the vertical edge strength Di,jVD^V_{i,j} between pixel (i,j)(i, j) and (i+1,j)(i+1, j), are computed using directional derivative masks:

    Di,jH=∣δ(xi,j−xi,j+1)+(xi−1,j−xi−1,j+1)+(xi+1,j−xi+1,j+1)+(xi,j−1−xi,j+2)∣(8+3δ)σD^H_{i,j} = \frac{\left| \delta (x_{i,j} - x_{i,j+1}) + (x_{i-1,j} - x_{i-1,j+1}) + (x_{i+1,j} - x_{i+1,j+1}) + (x_{i,j-1} - x_{i,j+2}) \right|}{(8 + 3\delta)\sigma}

    Di,jV=∣δ(xi,j−xi+1,j)+(xi,j−1−xi+1,j−1)+(xi,j+1−xi+1,j+1)+(xi−1,j−xi+2,j)∣(8+3δ)σD^V_{i,j} = \frac{\left| \delta (x_{i,j} - x_{i+1,j}) + (x_{i,j-1} - x_{i+1,j-1}) + (x_{i,j+1} - x_{i+1,j+1}) + (x_{i-1,j} - x_{i+2,j}) \right|}{(8 + 3\delta)\sigma}

    where δ≥0\delta \ge 0 is a control parameter governing mask edge smoothing (set to δ=7\delta = 7 for brain MRI to reduce noise sensitivity while preventing thick edges), and σ>0\sigma > 0 is a scaling parameter proportional to the minimum intensity difference indicating a potential boundary.

  7. Knowl 7 — Arc Capacity Assignment Function for Image Graphs

    model/method

    In graph-based image segmentation, pixels are represented as vertices and adjacent pixels are joined by arcs. To map edge strength Di,jpD^p_{i,j} (where p∈{H,V}p \in \{H, V\} denotes horizontal or vertical edges) to arc capacity Ci,jpC^p_{i,j}, a piecewise exponential function is employed:

    Ci,jp={e−(Di,jp)2,if Di,jp<3e−3Di,jp,if Di,jp≥3C^p_{i,j} = \begin{cases} e^{-(D^p_{i,j})^2}, & \text{if } D^p_{i,j} < 3 \\ e^{-3 D^p_{i,j}}, & \text{if } D^p_{i,j} \ge 3 \end{cases}

    This mapping assigns high capacities to weak edges (similar neighboring pixels) and low capacities to strong edges (dissimilar neighboring pixels). For Di,jp<3D^p_{i,j} < 3, a Gaussian-like quadratic decay provides sharp discrimination between weak and moderately strong edges. For Di,jp≥3D^p_{i,j} \ge 3, the function switches to a slower linear-exponential decay e−3Di,jpe^{-3 D^p_{i,j}} to prevent capacities from underflowing to numerical zero (e.g., below 10−1210^{-12}), avoiding the creation of tiny, isolated false clusters during cut removal.

  8. Knowl 8 — Small-Cluster Merging and Unclassified Pixel Labeling

    model/method

    To handle over-segmentation resulting from capacity thresholding at FTF_T, a post-clustering refinement procedure is applied:

    1. Clusters containing fewer than 5 pixels are designated as candidate small clusters.
    2. Unless a small cluster is separated in the cut tree Tc∗T_c^* by arc capacities substantially smaller than FTF_T, it is merged into the spatially adjacent neighboring cluster with ≥5\ge 5 pixels that has the smallest absolute difference in mean pixel intensity.
    3. Any small cluster (<5< 5 pixels) that cannot be merged into an existing neighbor is marked as "unclassified" to prevent noisy or ambiguous boundary pixels from distorting region statistics.
  9. Knowl 9 — Brain MRI Tissue Segmentation Performance

    empirical result

    The hierarchical graph-theoretic clustering algorithm was evaluated on a 256×256256 \times 256 cross-sectional brain magnetic resonance (MR) image of a patient with white matter lesions using parameters σ=3.0\sigma = 3.0, δ=7.0\delta = 7.0, and flow threshold FT=0.1F_T = 0.1:

    • Thresholding at FT=0.1F_T = 0.1 followed by small-cluster merging (<5< 5 pixels) segmented the image into 161 total clusters.
    • Pruning the skull and external tissues using the equivalent tree isolated 79 brain tissue clusters.
    • Interactive labeling grouped the 79 clusters into four primary clinical tissue categories: grey matter, white matter, ventricles, and tumor.
    • Unlike the Marr-Hildreth zero-crossing operator (which merged pixels from white matter and ventricles into single false regions due to shared zero crossings), the graph cut approach accurately maintained closed contours without forming spurious connections between distinct anatomical structures.
  10. Knowl 10 — Computational Acceleration of Hierarchical Graph Condensation

    empirical result

    On a 4-connected 256×256256 \times 256 pixel image graph containing 65,536 vertices:

    • Direct application of the standard Gomory-Hu algorithm on a Sun SPARCstation requires solving 65,535 maximum flow problems on full or near-full graphs, requiring over 12 hours of CPU time.
    • The hierarchical condensation algorithm (employing a three-level hierarchy to condense subgraphs and eliminate interior branches) reduced total CPU time to approximately 10 minutes on the same hardware.
    • For all cuts with capacity below threshold FTF_T, the resulting partially equivalent tree is identical to the exact Gomory-Hu cut tree of the full graph, guaranteeing identical global optimality.

Coverage note — A simple synthetic 12-patch illustrative example (Section II-D) and an aerial photograph edge detection experiment (Section V-B) were omitted in favor of the core theoretical condensation theorems, the primary hierarchical clustering algorithm, and the detailed brain MRI evaluation.

References

  1. 1.A. K. Jain and R. C. Dubes, Algorithms for Clustering Data. Englewood Cliffs, NJ: Prentice Hall, 1988.
  2. 2.R. O. Duda and P. E. Hart, Pattern Classification and Scene Analysis. New York: Wiley, 1973.
  3. 3.L. J. Hubert, "Some applications of graph theory to clustering," Psychometrika, vol. 38, pp. 435-475, 1974.
  4. 4.D. W. Matula, "Graph theoretic techniques for cluster analysis algorithms," in Classification and Clustering, J. Van Ryzin, Ed. New York: Academic Press, 1977, pp. 95-129.
  5. 5.C. T. Zahn, "Graph-theoretic methods for detecting and describing gestalt clusters," IEEE Trans. Comput., vol. 20, pp. 68-86, 1971.
  6. 6.R. Urquhart, "Graph theoretical clustering based on limited neighborhood sets," Pattern Recognit., vol. 15, pp. 173-187, 1982.
  7. 7.W. L. Koontz, P. M. Narendra, and K. Fukunaga, "A graph-theoretic approach to nonparametric cluster analysis," IEEE Trans. Comput., vol. 24, pp. 936-944, Sept. 1976.
  8. 8.Z. Wu and R. Leahy, "Tissue classification in MR images using hierarchical segmentation," in Proc. IEEE Int. Conf. Medical Imaging, Oct. 1990.
  9. 9.R. E. Jensen, "A dynamic programming algorithm for cluster analysis," Oper. Res., vol. 17, pp. 1034-1057, 1969.
  10. 10.W. L. Koontz, P. M. Narendra, and K. Fukunaga, "A branch and bound clustering algorithm," IEEE Trans. Comput., vol. 24, pp. 908-915, Sept. 1975.
  11. 11.L. P. Lefkovitch, "Conditional clustering," Biometrics, vol. 36, pp. 43-58, 1980.
  12. 12.R. E. Gomory and T. C. Hu, "Multi-terminal network flows," SIAM J. Appl. Math., vol. 9, pp. 551-570, 1961.
  13. 13.G. K. Coleman and H. C. Andrews, "Image segmentation bu clustering," Proc. IEEE, vol. 5, pp. 773-785, May 1979.
  14. 14.R. L. Cannon, J. V. Dave, J. C. Bezdek, and M. M. Trivedi, "Segmentation of a thematic mapper image using the fuzzy c-means clustering algorithm," IEEE Trans. Geoscience Remote Sensing, vol. 24, pp. 400-408, May 1986.
  15. 15.D. A. Ortendahl and J. W. Carlson, "Segmentation of magnetic resonance images using fuzzy clustering," in Proc. 10th Conf. Inform. Processing in Medical Imaging, 1988, pp. 91-106.
  16. 16.P. Sahoo, S. Soltani, and A. K. C. Wong, " A survey of thresholding techniques," Comput. Vision Graphics Image Processing, vol. 41, pp. 233-260, 1988.
  17. 17.D. Marr and E. Hildreth, "Theory of edge detection," Proc. Roy. Soc. Lon., vol. 207, pp. 187-217, 1980.
  18. 18.L. R. Ford, Sr. and E. Fulkerson, Flows in Networks. Princeton NJ: Princeton Univ. Press, 1962.
  19. 19.N. Christofides, Graph Theory: An Algorithmic Approach. New York: Academic Press, 1975.
  20. 20.L. Lovász and M. D. Plummer, Matching Theory. Amsterdam: Elsevier Science Pub. B.V., 1986.
  21. 21.R. K. Ahuja and J. B. Orlin, " A fast and simple algorithm for the maximum flow problem," Oper. Res., vol. 37, pp. 748-759, 1989.
  22. 22.S. Geman and D. Geman, "Stochastic relaxation, Gibbs distribution, and the Bayesian restoration of images," IEEE Trans. Pattern Anal. Machine Intell., vol. 6, pp. 721-741, Nov. 1984.
  23. 23.Z. Wu and R. Leahy, "A graph theoretic approach to image segmentation of MR images," in Proc. SPIE/SPSE's Symp. on Elect. Image Sci. & tech., vol. SPIE-1450, Feb. 1991.
  24. 24.Z. Wu, "Hierarchical and graph theoretic approaches to image segmentation and pattern classification," Ph.D. dissertation, Signal and Image Processing Inst., Univ. of Southern California, 1991.
  25. 25.Z. Wu and R. Leahy, "Unsupervised hierarchical segmentation of textured images based on homogeneity testing," USC-Signal & Image Processing Inst., Tech. Rep. #157, June 1990.

Citation

MLA
Wu, Z., and R. Leahy. “An Optimal Graph Theoretic Approach to Data Clustering: Theory and Its Application to Image Segmentation”. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 15, no. 11, 1993, pp. 1101–13, https://doi.org/10.1109/34.244673.
APA
Wu, Z., & Leahy, R. (1993). An optimal graph theoretic approach to data clustering: theory and its application to image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 15(11), 1101–1113. https://doi.org/10.1109/34.244673
Chicago
Wu, Z., and R. Leahy. 1993. “An Optimal Graph Theoretic Approach to Data Clustering: Theory and Its Application to Image Segmentation”. IEEE Transactions on Pattern Analysis and Machine Intelligence 15 (11): 1101–13. https://doi.org/10.1109/34.244673.
Harvard
Wu, Z. and Leahy, R. (1993) “An optimal graph theoretic approach to data clustering: theory and its application to image segmentation”, IEEE Transactions on Pattern Analysis and Machine Intelligence, 15(11), pp. 1101–1113. Available at: https://doi.org/10.1109/34.244673.
Vancouver
1. Wu Z, Leahy R (1993) An optimal graph theoretic approach to data clustering: theory and its application to image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence 15:1101–1113

BibTeX

@article{Wu_1993, title={An optimal graph theoretic approach to data clustering: theory and its application to image segmentation}, volume={15}, ISSN={0162-8828}, url={http://dx.doi.org/10.1109/34.244673}, DOI={10.1109/34.244673}, number={11}, journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, publisher={Institute of Electrical and Electronics Engineers (IEEE)}, author={Wu, Z. and Leahy, R.}, year={1993}, pages={1101–1113} }
Metadata:Crossref

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF