A bridge of an undirected graph is defined as any edge whose removal increases the number of connected components. Please compute all the bridges of a given graph.
Input consists of several cases, each with the number of vertices , followed by the number of edges , followed by pairs indicating an edge between and , with . Assume , , that vertices are numbered starting from zero, and that there is at most one edge connecting any pair of vertices.
For every graph, print the number of bridges, followed by a line with those bridges. The two vertices of each bridge must be sorted increasingly, and the bridges themselves must also be sorted increasingly. Print a line with 10 dashes at the end of every case.
Author: Salvador Roura
Generation: 2026-01-25T10:33:23.177Z
© Jutge.org, 2006–2026.
https://jutge.org