add function to add a node into DynamicGraph
refactor DynamicGraph to use integer ranges where possible