Calculator Input
Use edge pairs or an adjacency matrix. Directed graphs support weak and strong analysis.
Example Data Table
| Sample Case | Vertices | Graph Type | Input | Expected Components | Component Sizes |
|---|---|---|---|---|---|
| Example A | 7 | Undirected | 1-2, 2-3, 4-5 | 4 | 3, 2, 1, 1 |
| Example B | 5 | Directed, Weak | A→B, B→C, D→E | 2 | 3, 2 |
| Example C | 4 | Directed, Strong | 1→2, 2→1, 3→4 | 3 | 2, 1, 1 |
The default form values reproduce Example A. Submit them immediately to verify the counter and export features.
Formula Used
For undirected graphs, a connected component is a maximal vertex set where every pair of vertices is reachable by some path.
For directed graphs, the calculator can measure weak connectivity by ignoring edge direction, or strong connectivity by requiring mutual reachability.
The component count is found by graph traversal. Breadth-first search identifies ordinary and weak components, while Kosaraju’s method identifies strong components.
- Connected components: Count of disjoint reachable vertex groups.
- Density, undirected: 2m / (n(n - 1))
- Density, directed: m / (n(n - 1))
- Cycle rank: m - n + c for the underlying simple graph.
Here, n is the number of vertices, m is the non-loop edge count, and c is the number of components.
How to Use This Calculator
- Enter the total number of vertices in your graph.
- Choose whether the graph is undirected or directed.
- Select standard, weak, or strong connectivity as needed.
- Pick edge list or adjacency matrix input.
- Optionally enter custom labels, such as A, B, C, and D.
- Paste your graph data into the relevant input area.
- Enable duplicate filtering or case sensitivity when appropriate.
- Press Count Components to view results above the form.
- Download the summary and membership tables as CSV or PDF.
FAQs
1. What does a connected component mean?
A connected component is a largest possible set of vertices that stay reachable from one another. No vertex outside that set can join without breaking the definition.
2. What is the difference between weak and strong connectivity?
Weak connectivity ignores arrow direction and checks reachability in the underlying undirected graph. Strong connectivity requires every vertex in a component to reach every other vertex using directed paths.
3. Can I use weighted graphs here?
Yes. In edge lists, any extra third value is ignored. In adjacency matrices, every nonzero value is treated as an edge, so weights do not change the connectivity count.
4. Are isolated vertices counted as components?
Yes. A vertex with no incident edges forms its own component. The calculator reports both the number of isolated vertices and their labels.
5. Why would I ignore duplicate edges?
Duplicate edges can inflate edge totals and density without changing connectivity. Enabling duplicate filtering keeps the graph simple and makes summary metrics easier to interpret.
6. How are self-loops handled?
Self-loops are counted separately and marked in the summary. They do not merge different vertices into one component, but they prevent that vertex from being classified as isolated.
7. Is this suitable for larger graphs?
Yes, for many classroom, research, and workflow cases. This version accepts up to 500 vertices to keep browser rendering, form handling, and exported reports practical.
8. When should I use edge lists instead of matrices?
Use edge lists for sparse graphs and fast editing. Use adjacency matrices when you already store data as square tables or want direct row-by-row verification.