Directed Graph
Hi,
I'm trying to write a directed graph class.
My graph is stored in a hash map, with key being an Object that describes the node (eg A) and the value being a list of Ojects (linked list) describing its neighbours (eg if A->B and A->C, value would contain B and C)
I need a method which returns true if theres a loop (i.e. if there is a path from node A back to node A eg. A->B->A). This needs to be as efficient as possible (i.e. should only go through graph once)
Any suggestions?
Thanks

