graph: Dijkstra works; classes rearranged to separate headers