Graph inner class of Djkstra