[Urgent] Generating dynamic graphs @ runtime?

V

viki.sanjeeva

Hi,
This task is very new for me and I have to do it for my client. Ok,
here is what I have to do:

1) The user will input a square matrix in a text file.
2) Java program will read this text file and will validate whether the
input matrix is square or not? If yes then continue; else error screen.
3) After successfull validation, it will create a graph based on the
values of matrix.
4) The created (generated) graph (image) will be displayed as an output
to the user on his browser.

The business logic here is the method of creating graph based on matrix
values. This method I know well on paper-pencil. But implementing the
same in Java code and generating the graph is bit new. The later part,
i.e. generating the graph is in fact the actual task.

I've developed an explained example with matrix (input) and the
generated graph (output) here:
http://www.uploadfile.info/uploads/457e277a37.jpg

In the graph, you will see objects are linked with each other via
arrows. This linking is decided on the matrix values. Most probably, I
will be having images of objets saved in my haardisk. Only Linking them
@ runtime have to be done.

Looking forward for the guideline to start implementing the task.

Thanks,

Bye,
Viki.
 
S

Simon

Hi,
1) The user will input a square matrix in a text file.
2) Java program will read this text file and will validate whether the
input matrix is square or not? If yes then continue; else error screen.
3) After successfull validation, it will create a graph based on the
values of matrix.
4) The created (generated) graph (image) will be displayed as an output
to the user on his browser.

If I get this right, than what you have is commonly called an "adjacency matrix"
of a graph.
The business logic here is the method of creating graph based on matrix
values. This method I know well on paper-pencil. But implementing the
same in Java code and generating the graph is bit new. The later part,
i.e. generating the graph is in fact the actual task.

Now, what do you want to do? Of course you can place your vertices on a circle
or grid or in a random fashion somewhere on the screen and draw lines with an
arrow head between adjacent vertices, but that won't give you decent results
because you will get a clutter of lines all over the screen. There is no trivial
and general way to draw a graph in a nice way and in fact there is a lot of
research going on about that. You can google for "graph drawing", but if your
project is really "urgent" I doubt you will finish that in time :)

Of course, there are specialized methods if your graph has some known
properties, e.g. if it is bibartite or a tree, but that depends on your
application...

Cheers,
Simon
 
T

Tris Orendorff

(e-mail address removed) burped up warm pablum in
Hi,
This task is very new for me and I have to do it for my client. Ok,
here is what I have to do:

1) The user will input a square matrix in a text file.
2) Java program will read this text file and will validate whether the
input matrix is square or not? If yes then continue; else error screen.
3) After successfull validation, it will create a graph based on the
values of matrix.
4) The created (generated) graph (image) will be displayed as an output
to the user on his browser.

LIAR, LIAR pants on FIRE.

Own up. This is homework. No client would hire a consultant to do
something so vague as "imput a square matrix in a text file." Those
numbers must mean something to the client.
 
N

Nigel Wade

Hi,
This task is very new for me and I have to do it for my client. Ok,
here is what I have to do:

1) The user will input a square matrix in a text file.
2) Java program will read this text file and will validate whether the
input matrix is square or not? If yes then continue; else error screen.
3) After successfull validation, it will create a graph based on the
values of matrix.
4) The created (generated) graph (image) will be displayed as an output
to the user on his browser.

The business logic here is the method of creating graph based on matrix
values. This method I know well on paper-pencil. But implementing the
same in Java code and generating the graph is bit new. The later part,
i.e. generating the graph is in fact the actual task.

I've developed an explained example with matrix (input) and the
generated graph (output) here:
http://www.uploadfile.info/uploads/457e277a37.jpg

You created that? It wasn't part of the problem sheet handout you were given?
In the graph, you will see objects are linked with each other via
arrows. This linking is decided on the matrix values. Most probably, I
will be having images of objets saved in my haardisk. Only Linking them
@ runtime have to be done.

Looking forward for the guideline to start implementing the task.

Thanks,

Bye,
Viki.

http://java.sun.com/docs/books/tutorial/2d/index.html

Read and enjoy. Learning for yourself will prepare you better for your future
problem classes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top