Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Mathematica, Graph Theory

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83229] Mathematica, Graph Theory
  • From: Xuding <zhu at math.nsysu.edu.tw>
  • Date: Thu, 15 Nov 2007 05:44:48 -0500 (EST)

I delete some vertices of a graph, using DeleteVertices command, the name of the vertices in the new graph changed.

For example, let h=CompleteGraph[4]. It has vertices {1,2,3,4}. Let g=DeleteVertices[h,{1,2}]
Then Vertices[g] is equal to {1,2}, instead of {3,4}. What should I do so that the vertices of the resulting graph keep their old names? 

I used SetVertexLabel to label the vertices. After the deletion, the labels are correct. However, I do not know how to use the labels. For example, after labeling the vertices of h by {1,2,3,4}, the labels of the vertices of g are 3,4. But Edges[g]={ {1,2}}, not {{3,4}} (which is what I need). 

Thank you for your help!
Xuding


  • Prev by Date: How format label in Manipulate iterator's Appearance->"Labeled"?
  • Next by Date: Re: Solving simple equations
  • Previous by thread: How format label in Manipulate iterator's Appearance->"Labeled"?
  • Next by thread: Re: Mathematica, Graph Theory