set up graph inheritance hierarchy

still need to make iterators work for both graph types