Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [Urgent] Generating dynamic graphs @ runtime?

Reply
Thread Tools

[Urgent] Generating dynamic graphs @ runtime?

 
 
viki.sanjeeva@gmail.com
Guest
Posts: n/a
 
      03-06-2006
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.

 
Reply With Quote
 
 
 
 
Simon
Guest
Posts: n/a
 
      03-06-2006
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
 
Reply With Quote
 
 
 
 
Tris Orendorff
Guest
Posts: n/a
 
      03-09-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) burped up warm pablum in
news:(E-Mail Removed) oups.com:

> 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.



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-09-2006
On 6 Mar 2006 01:48:07 -0800, (E-Mail Removed) wrote, quoted or
indirectly quoted someone who said :

>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.


nobody on earth talks that way except CS profs near retirement. See
http://mindprod.com/jgloss/homework.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      03-10-2006
(E-Mail Removed) wrote:

> 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.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : (E-Mail Removed)
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Profiling and generating call graphs Andrea Crotti C Programming 1 07-31-2010 01:34 PM
Re: Generating SVG Graphs Andreas Waldenburger Java 1 01-27-2009 12:21 AM
profiling C code an generating call graphs horacius.rex@gmail.com C Programming 7 05-29-2007 10:49 AM
Generating graphs with Ruby: monochrome style with SVG::Graph? ajalkane Ruby 0 01-03-2007 08:56 AM
generating graphs from table Ike HTML 3 12-17-2003 07:27 AM



Advertisments