Finished implementations for graphs. For testing.

Changed the convention regarding the representation of disconnected nodes.
Disconnected nodes are now represented with a negative value.