[Urgent] Generating dynamic graphs @ runtime?

Discussion in 'Java' started by viki.sanjeeva@gmail.com, Mar 6, 2006.

  1. Guest

    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.
    , Mar 6, 2006
    #1
    1. Advertising

  2. Simon Guest

    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
    Simon, Mar 6, 2006
    #2
    1. Advertising

  3. burped up warm pablum in
    news::

    > 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.
    Tris Orendorff, Mar 9, 2006
    #3
  4. Roedy Green Guest

    On 6 Mar 2006 01:48:07 -0800, 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.
    Roedy Green, Mar 9, 2006
    #4
  5. Nigel Wade Guest

    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 :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
    Nigel Wade, Mar 10, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ike
    Replies:
    3
    Views:
    427
    Nico Schuyt
    Dec 17, 2003
  2. Replies:
    7
    Views:
    617
  3. Andreas Waldenburger

    Re: Generating SVG Graphs

    Andreas Waldenburger, Jan 26, 2009, in forum: Java
    Replies:
    1
    Views:
    377
    Andreas Waldenburger
    Jan 27, 2009
  4. Andrea Crotti

    Profiling and generating call graphs

    Andrea Crotti, Jul 29, 2010, in forum: C Programming
    Replies:
    1
    Views:
    433
    Andrea Crotti
    Jul 31, 2010
  5. ajalkane
    Replies:
    0
    Views:
    110
    ajalkane
    Jan 3, 2007
Loading...

Share This Page