Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Graph algorithms

Name: Anonymous 2010-07-30 19:53

Hey /pros/, gimme graphing algorithms.  Specifically, I have a bunch of connected nodes.  The graph has a bunch of "input" nodes on the far left and a bunch of "output" nodes on the far right.  These are fixed and can't be repositioned.  In the middle is a rat's nest of connected nodes and anything goes (loops, self-connections, double connections, etc).  So, there's no guarantee that the graph can even be made planar (non-overlapping).  I need an algorithm that does the best possible job of moving those middle nodes around and sorting things out, efficiently.

Name: Anonymous 2010-07-30 21:05

Try using Graphviz.

Name: Anonymous 2010-07-30 22:37

$ man gnuplot
GNUPLOT(1)                                                                                                            GNUPLOT(1)

NAME
       gnuplot - an interactive plotting program

SYNOPSIS
       gnuplot [ X11 options ] [file ...]

DESCRIPTION
       Gnuplot is a command-driven interactive function plotting program.

       If  files are given, gnuplot loads each file with the load command, in the order specified.  Gnuplot exits after the last
       file is processed.

       Here are some of its features:

       Plots any number of functions, built up of C operators, C library functions, and some things  C  doesn't  have  like  **,
       sgn(), etc.  Also support for plotting data files, to compare actual data to theoretical curves.

       User-defined X and Y ranges (optional auto-ranging), smart axes scaling, smart tic marks.

       Labelling of X and Y axes.

       User-defined constants and functions.

       Support for many output devices and file formats

       Shell escapes and command line substitution.

       Load and save capability.

       Output redirection.

       All  computations  performed  in the complex domain.  Just the real part is plotted by default, but functions like imag()
       and abs() and arg() are available to override this.

Name: Anonymous 2010-07-30 22:56

>>1
Check out how C++ compilers make optimizations based on the AST.

Name: Anonymous 2010-07-31 0:26

>>4
If optimizing the AST has anything to do with what >>1 is saying, I will be impressed.

Name: Anonymous 2010-07-31 1:10

>>5
Like I give a shit if it has anything to do with it. I just said something random and difficult but not 100% implausible and hoped he would go away.

But ``he'' didn't, did ``he''?

Name: Anonymous 2010-07-31 3:43

Here's the general idea for a good solution to your problem:

1. Move center nodes that have more inputs than outputs closer to the input side.

2. Move center nodes that have more outputs than inputs closer to the output side

3. Spread the nodes away from each other using a distance threshold that would scale down as more nodes are added to the graph.

Name: Anonymous 2010-08-01 6:18

Name: Anonymous 2010-11-13 15:21

Name: Anonymous 2011-02-04 14:09

Name: Anonymous 2011-02-18 13:59

<-- that's cool and all, but check my doubles over there
Don't change these.
Name: Email:
Entire Thread Thread List