MathGroup Archive 2007

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

Search the Archive

WeightingFunction and Showing Graphs with wieghts as Edge Lable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83111] WeightingFunction and Showing Graphs with wieghts as Edge Lable
  • From: mumat <csarami at gmail.com>
  • Date: Sun, 11 Nov 2007 03:00:17 -0500 (EST)

Hi,

I couldn't find this in documentation Mathematica 6.

First Question: I construct a graph with edge weights selected from a
given list say, {2,3,5,7}. In the documentaion says:

SetEdgeWeights[g, e, w]=assigns the weights in the weight list w to
the edges in edge list \e. Here's one example

In[1]=t = Wheel[8];k = SetEdgeWeights[t, WeightingFunction ->
RandomInteger, WeightRange -> {0, 4}]

In[2]=Edges[k, EdgeWeight]

But this is not clearly what I want. I want to weights to be selected
from {2,3,5,7}.

Question 2: In the other part of the documentation says:

WeightingFunction can take values Random, RandomInteger, Euclidean, or
LNorm[n] for nonnegative n, or any pure function that takes two
arguments, each argument having the form {Integer,{Number,Number}}.

How can I construct one weightingFunction? Can anyone make one?

I don't know why the first argument of the first argument show be an
integer! Let's say the vertices of a given graph are labled {1,...n}.
How can we set weights of the edges to be the average of the vertices
incident on the edges!


Question 3. How can I graph a weighted Graph show the edgeweights show
up on the graph? for instance for this graph?

In[1]=t = Wheel[8];k = SetEdgeWeights[t, WeightingFunction ->
RandomInteger, WeightRange -> {0, 4}]

Any help would be greatly appreciated.



  • Prev by Date: Re: Optimizing fixed point iteration
  • Next by Date: Re: Optimizing fixed point iteration
  • Previous by thread: Re: RE: greetings and a question!
  • Next by thread: Re: WeightingFunction and Showing Graphs with wieghts as Edge Lable