add_edge bugfix and add convenience functions

This pull request

* Exposes two convenience functions to get the number of nodes and edges in the topology; and
* Fix a bug in `add_edge` to prevent adding duplicates