MathGroup Archive 2008

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

Search the Archive

Re: Re: EdgeRenderingFunction to produce edge labels in

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87771] Re: [mg87718] Re: EdgeRenderingFunction to produce edge labels in
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Wed, 16 Apr 2008 22:31:00 -0400 (EDT)
  • References: <200804160902.FAA23830@smc.vnet.net>

P_ter wrote:

>Carl Woll writes:
>DeleteCases[
>Thread[Range[Length[vertices]] -> (VertexLabel /.
>vertices[[All,2 ;;]])],
>_ -> VertexLabel
>];
>I am just curious. Why the DeleteCases? In this simple example DeleteCases does nothing. In what kind of graph would it have a function?
>with friendly greetings,
>P_ter
>  
>
I wanted my code to handle the case where some or all vertex labels are 
unspecified. For example, without the DeleteCases you would obtain the 
following for Cycle[3]:

g=Cycle[3]

Graph[{{{1, 2}}, {{2, 3}}, {{1, 3}}},
   {{{-0.4999999999999998, 0.8660254037844387}},
     {{-0.5000000000000004, -0.8660254037844384}}, {{1., 0}}}]

vertices = g[[2]];

Thread[Range[Length[vertices]] -> (VertexLabel /. vertices[[All, 2;;]])]

{1->VertexLabel,2->VertexLabel,3->VertexLabel}

Obviously, I don't want to perform these replacement rules on the list 
of vertices.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Any One have an idea?
  • Next by Date: Re: Dynamic (more)
  • Previous by thread: Re: EdgeRenderingFunction to produce edge labels in GraphPlot
  • Next by thread: Manipulate on the web