MathGroup Archive 2004

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

Search the Archive

RE: David's CombinatoricaGraphics functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47708] RE: [mg47703] David's CombinatoricaGraphics functions
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 23 Apr 2004 02:30:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Sean,

Needs["CombinatoricaGraphics`CombinatoricaGraphics`"]

lg = Graph[{
 {{1, 2}}, {{2, 3}},
 {{3, 2}}, {{3, 1}},
 {{1, 4}}, {{1, 4}}, {{1, 5}}, {{1, 5}},
 {{4, 5}}, {{4, 2}}, {{4, 2}},
 {{5, 2}}, {{5, 2}}, {{5, 4}}, {{5, 4}}},

{{{0.0, 1.5}, VertexLabel -> a1},
{{0.0, 0.0}, VertexLabel -> b2},
{{0.5, 0.75}, VertexLabel -> c3},
{{-0.5, 0.75}, VertexLabel -> d4},
{{-1.5, 0.75}, VertexLabel -> e5}},  EdgeDirection ->
On]

I would redefine the graph. Maybe there is an easier way to do this.

edges = Edges[lg];
MakeGraph[Range[5], MemberQ[edges, {#1, #2}] &];
ChangeVertices[%, Vertices[lg]];
lg2 = AddEdges[%, {{1, 4}, {1, 5}, {4, 2}, {5, 2}, {5, 4}}]

CombinatoricaPlot[
    {DrawGraphEdges[lg2][All],
     DrawGraphVertices[lg2][All],
     LabelGraphVertices[lg2][All, {a1, b2, c3, d4, e5}]},
    Background -> White];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: sean kim [mailto:sean_incali at yahoo.com]
To: mathgroup at smc.vnet.net

Hello group and david.

I love david's Package for improving Combinatorica
graphics.

it's amazing. Thank you, david, for making that.

and obviously by the looks of this email, and the fact
that I'm writing, yes.. I have a few problems.

please consider the following digraph.

In[12]:=
lg = Graph[{
 {{1, 2}}, {{2, 3}},
 {{3, 2}}, {{3, 1}},
 {{1, 4}}, {{1, 4}}, {{1, 5}}, {{1, 5}},
 {{4, 5}}, {{4, 2}}, {{4, 2}},
 {{5, 2}}, {{5, 2}}, {{5, 4}}, {{5, 4}}},

{{{0.0, 1.5}, VertexLabel -> a1},
{{0.0, 0.0}, VertexLabel -> b2},
{{0.5, 0.75}, VertexLabel -> c3},
{{-0.5, 0.75}, VertexLabel -> d4},
{{-1.5, 0.75}, VertexLabel -> e5}},  EdgeDirection->
On]

ShowGraph[lg]

CombinatoricaPlot[
    {DrawGraphEdges[lg][All],
      DrawGraphVertices[lg][All]},
    Background -> White];

above will produce two graphics. onedefault and one
produced by david's new package.

1. How come the CombinatoricaPlot isn't drawing the
directed edges using DrawGraphBowArrow as a default?

2. As far as I understand it, a tour is a path in a
digraph where you only cross every vertex once,
before returning to the starting pt( in this case, a1)

How do I show all tours that are possible withthe
digraph above?

3. how do I show that all the tours are isomorphic?
or is that an obvious question?

thanks in advance once again for all comments.

sean







__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash




  • Prev by Date: Re: Trig identity oscillations
  • Next by Date: Interesting integral problem
  • Previous by thread: David's CombinatoricaGraphics functions
  • Next by thread: Integer parameter in a limit