Breadth first Search on Open Street Maps in Java

Hi there,
for a uni project I have to complete breadth/depth first search on Open Street Maps, however I am really struggling.

Firstly, I have successfully managed to parse a segment of data using osmosis(java). What I then tried to do was create an edge object out of Ways so that
Edge(StartNode,EndNode,Length) where length was worked out by the difference in latitude and longitudes. This was semi-successful. However, for me to use this approach, I was checking for Edges that start with the same node that my current edge ends on. However, this never seems to be the case.

How would you guys approach search? A Pseudo idea would really help me out as I have been stuck on this for a couple of weeks now.

Please let me know if I can clarify any of the above or if code snippets would help.



Do you know ?

There a some opensource solutions. Does this hit your aim?