MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ShowGraph vs. GraphPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109050] Re: ShowGraph vs. GraphPlot
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Mon, 12 Apr 2010 06:51:10 -0400 (EDT)

I think it's primarily a historical issue.  The functions for dealing 
with graphs began in, and mostly still reside in, the standard add-on 
package Combinatorica.  And that's where ShowGraph is.

But in recent versions of Mathematica, combinatoric functions have 
evidently begun a migration into the kernel.  In particular, as is 
typical with the evolving language design, the syntax of functions for 
different kinds of graphing is being rationalized.

GraphPlot, in the kernel, does not require that you first create an 
object with head Graph (using a Combinatorica function to do so) to feed 
in as the argument for what is to be plotted.

GraphPlot and ShowGraph handle differently such things as labeling edges 
and vertices, and even choosing where to put the vertices.  GraphPlot 
allows much finer control over the labeling and even the styling of 
vertices and edges -- often with the expense of complicated options; 
ShowGraph typically involves less work to produce labeled graphs, but 
with less control over the results.

You might want to take a look at the notebook Graphs.nb that I last 
revised in 2009 for a course. It covers both ShowGraph and GraphPlot and 
shows how to convert between the older Combinatorica-type Graph objects 
and the newer GraphPlot-friendly graph structures, and converting labels 
for one to the other.  See:

   http://www.math.umass.edu/~murray/Math_455_Eisenberg/Files/files.html

On 4/11/2010 4:31 AM, becko wrote:
> What's the difference between the functions GraphPlot and
> Combinatorica`ShowGraph?
>
> Why are there two functions for the same task?
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: List Manipulation: Conditionally changing y value when x value
  • Next by Date: Re: if using Mathematica to solve an algebraic
  • Previous by thread: ShowGraph vs. GraphPlot
  • Next by thread: Change of function in an ODE