0

I'm working on visualization of shortest path algorithms. I have a graph of edges and vertices and I'd like to draw it using JGraph. So far I used as an example this code: JGraph in a JFrame

It works nice, but it has fixed coordinates of cells(vertices). I plan to have a LinkedList of randomly generated number of vertices and edges of random length, and some edges will be uni or bidirectional.

How to create such JGraph that will automatically place cells in suitable way? Coordinates are arbitrary but lengths have to maintain proportions. Do I need to use external algorithm to do that?

Community
  • 1
  • 1
Mike
  • 809
  • 6
  • 20

0 Answers0