check before adding edge that it does not already exist

Avoid double-adds of edges by checking if an edge already exists.  This
involves a linear scan, which is probably quickest for the small numbers of
edges which we expect in the sequence graphs.

Also, adds a function to print the graph to stderr.