Put the declaration of edge before graph, or put a forward declaration of edge before graph.
Ideally each class declaration should be in it's own header file. The implementations should be in their own .cpp files. Then include the appropriate header file where it is needed. Do fwd declarations to avoid circular dependencies.