Example 1: From your graph:
(0,2),(0,3),(1,2),(1,3)
2
/ \
0 1
\ /
3
K(0, 1)
Create a tree like this:
0
/ \
2 3
/ \
1 1
Each branch begins at 0 and ends at 1. If a branch does not reach 1, it's not included. Remove the topmost edges (in case of branching below that point). It doesn't matter if you build the tree from 0 to 1 or from 1 to 0 since the graph is bidirectional.
Example 2: Graph:
(0,1),(1,2),(2,3)
0 -- 1 -- 2 -- 3
K(1, 2)
Tree:
1
|
2
Remove:
(1,2)
Example 3: Graph:
(0,2),(0,3),(0,4),(1,2),(1,3)
0
/ | \
2 3 4
\ /
1
K(0, 1, 4)
Tree:
0
/ | \ <-- 2 edges leading to 1; 1 edge leading to 4
2 3 4
| |
1 1
Remove:
(0,4)