Graph in java

Hello,

Please how can represent this graph in java ?

i have to apply an algorithm on this graphe, the first instruction of the algorithm is to verify if the three last vertices are dependent or not ?

Thank you.

A class for nodes ( coordinates, a (stock) collection of line references ) and a class for lines ( 2 end node references and maybe cached length ), where lines by definition run between not through nodes, even if another line goes out the other side in line with the first, and the class for the graph is a (stock) collection of nodes. Normal graphs have nodes ordered by coordinate x, y, z order. Normal lines will have the first node lower in order. Normal nodes have the lines in remote end order. Normalization can halve the computational load of many searches, and suggests an ordered collection like an array or tree, not a hash. However, if the majority of searches are equal, and there are many elements, hash mapping may be faster and collections should be considered orderless. If the set in your graphs is very dynamic and collections large, a linear hash or tree is good - no sliding arrays up and down. (Do intersecting lines make a node, or do they magically miss if no node is established, like ship lanes in the ocean?)

I suppose the lines could be in the node only, but they would be there twice -- if far node coord > this node coord then continue?

Might want a trivial class for coord that knows how to compare them.