Skip to main content
OCMEBilingual mathematics & derivations繁體中文

OCME · Bilingual mathematics & derivations

Concept derivation guides

299 concept teaching guides, separate from the 36,000 individual question derivations.

Search all questions & derivations →

Concept guide

Connected components: finding every component of a finite simple graph by complete BFS

Let G=(V,E) with V={0,1,2,3,4,5,6} and E consisting of exactly the five edges {0,1}, {0,2}, {1,2}, {3,4}, {4,5}. First prove that 'joined by a path' is an equivalence relation on V; then compute each equivalence class by complete BFS, prove that the set BFS returns is exactly that class, and conclude Q(G)={{0,1,2},{3,4,5},{6}}, where the isolated vertex 6 forms a singleton component.

Connected component

derivation-mko-connected-component-01