Connected component (graph) using weighted quick union with path compression (wqupc)

Connected component (graph) using weighted quick union with path compression (wqupc)

You are now following this Submission

Input: G
G is an (n,n) undirected graph matrix, where n is the number of vertices
Output: labels
labels of the n vertices

Usage:
id = wqupc(G);
labels = id2labels(id);

Cite As

Changqing Wang (2026). Connected component (graph) using weighted quick union with path compression (wqupc) (https://www.mathworks.com/matlabcentral/fileexchange/57542-connected-component-graph-using-weighted-quick-union-with-path-compression-wqupc), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Graph and Network Algorithms in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0