Identifying a Tree by Edge Count

Coding
Graph Theory
Easy
A connected undirected graph contains n vertices and exactly n-1 edges. What structure must it be?
Hint 1

Recall the characterization of trees in terms of connectivity and edge count.

Hint 2

A connected graph with exactly n-1 edges cannot contain a cycle.

Show worked solution
  1. 1. Rule out cycles

    If a connected graph on vertices with edges contained a cycle, removing one edge from that cycle would keep it connected with only edges, which is too few to connect vertices (a connected graph needs at least edges), a contradiction.

  2. 2. Conclude it is a tree

    A connected graph with no cycles and exactly edges is, by definition, a tree.

Answer: A tree.

Related roles: Browse quant jobs

Related problems