=== Problem G  breadth-first search from A ===
step  dequeue  discovered            queue after
   1        A  B:1 C:1               B:1 C:1 
   2        B  D:2 E:2               C:1 D:2 E:2 
   3        C  F:2                   D:2 E:2 F:2 
   4        D  G:3                   E:2 F:2 G:3 
   5        E  H:3                   F:2 G:3 H:3 
   6        F  -                     G:3 H:3 
   7        G  I:4                   H:3 I:4 
   8        H  -                     I:4 
   9        I  -                     (empty)
v         A   B   C   D   E   F   G   H   I
d[v]      0   1   1   2   2   2   3   3   4
pi[v]     -   A   A   B   B   C   D   E   G
tree edges: 8 = |V| - 1 = 8

=== Problem H  depth-first search, all seven vertices ===
v            A     B     C     D     E     F     G
d/f       1/12   2/5  6/11   3/4  7/10   8/9 13/14
pi           -     A     A     B     C     E     -
clock stopped at 14 = 2|V| = 14
arc     class
 A->B   tree
 A->C   tree
 A->D   forward
 B->D   tree
 C->D   cross
 C->E   tree
 D->A   back
 E->F   tree
 F->E   back
 G->C   cross
 G->F   cross
tree 5, back 2, forward 1, cross 3  (total 11)
the forest has 2 trees, so 7 - 2 = 5 tree edges
parenthesis structure: (A (B (D D) B) (C (E (F F) E) C) A) (G G) 
the graph has 2 back edge(s), so it is NOT acyclic

=== Problem J  connected components ===
vertex     1   2   3   4   5   6   7   8   9  10  11  12
comp       0   0   0   1   1   1   1   2   2   2   2   2
number of components: 3
  1 and 3  connected? yes
  1 and 4  connected? no
  5 and 7  connected? yes
  6 and 11 connected? no
  8 and 12 connected? yes
edges 11, vertices 12, components 3; a forest would need 9 edges, this has 11

=== Problem K  bipartiteness ===
G1: BIPARTITE; sides {ADEFI} and {BCGH}
G1 plus the edge E-F: NOT bipartite; the edge E-F joins two vertices of the same color. Odd cycle: EBACFE

=== Problem L  cycle detection ===
  path A-B-C-D          : acyclic (a forest)
  square A-B-C-D-A      : has a cycle
  G1                    : has a cycle
  two parallel edges A=B: has a cycle
  G2                     : has a directed cycle
  A->B, A->C, B->C       : is a DAG
  A->B, B->C, C->A       : has a directed cycle
