Why does an undirected graph with n vertices have at most edges?
In an undirected graph, there can be at most one edge between any pair of distinct vertices. The maximum number of edges is achieved by a complete graph, which equals the total number of unordered pairs of vertices, calculated as .
Conditions
- G is an undirected graph.
- G has n vertices.
- We seek the possible maximum number of edges.
Reasoning, step by step
- Identify that each vertex can connect to n-1 other vertices.
- Sum the connections for all n vertices, yielding .
- Divide by 2 because each undirected edge is counted twice (once for each endpoint).
- Conclude that the maximum number of edges is .
Example
For a complete graph with 5 vertices, the presenter counts the edges as , which equals . This generalizes to for n vertices.
Common misconceptions
- Confusing the maximum number of edges in an undirected graph with that in a directed graph (which is ).
- Assuming that a connected graph must be a complete graph, whereas a connected graph only requires a path between vertices, not direct adjacency.
Watch the explanation
4:12 – 5:13Watch this moment ↗
Explore next
Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.