COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### GraphPath With Edge Weights

• Email
• Follow

```I can't figure out how to compute a shortest path using GraphPath with
edge weights. I first define a graph as follows.

graph = Graph[{UndirectedEdge[1,2], UndirectedEdge[2,3],
UndirectedEdge[3,1]}, EdgeWeight->{1, 2, 9}]

it correctly returns the shortest path distance of 3 corresponding to
the path {1, 2, 3}.  But if I compute GraphPath[graph, 1, 3] it
returns the unweighted shortest path {1, 3}. Even if I use
GraphPath[graph, 1, 3, Weighted->True] it still returns the same
answer of {1, 3}. (Weighted is supposed be True by default anyway.)
What am I doing wrong?

Thanks.

```
 0
Reply benp84 (6) 5/28/2012 9:14:05 AM

See related articles to this posting

0 Replies
39 Views

Similar Articles

12/13/2013 4:43:29 AM
[PageSpeed]

Similar Artilces:

Igraph Library Weighted Edges
In Igraph library (http://cneurocvs.rmki.kfki.hu/igraph/) there's a method to add a weighted edge? alessandro.carrega wrote: > In Igraph library (http://cneurocvs.rmki.kfki.hu/igraph/) there's a > method to add a weighted edge? Maybe. What was your C++ language question? Did you even *try* Google? I have no idea what this library is, but a search for igraph library weighted edge gave some ideas. Please read the FAQ, especially section 5 (http://www.parashift.com/c++-faq-lite/how-to-post.html) before asking questions like this. On 29 Dic, 00:08, red floyd <no.s...@here...

Edges, edges, edges
Dear folks: I just went from SW2004 and SW2006 and am pleased to report a 25% drop in departmental efficiency...*sigh*. This happened last time I upgraded too, but I recovered... Anyway, I used to select unwanted part edges in a drawing, hide them, and when they didn't, find a handy surface and do the Show/Hide Edges (Show, then Hide) routine, and everything would rebuild and be lovely. But now I can't do that. Has anybody got more ideas? I can select them fine, just not hide them. Cordiallly yours, Gerard P. Lakeview Forge Co. ...

RE: Weight Decay: What constitutes a "large" weight (and a "small" weight)
I've just started looking at my weights (well, actually my "strengths" as provided by NS2) and started looking at introducing random inputs and reducing my initial weights. Model is 68 inputs, 7 hidden, and single output, 1200 training set, no test set, manually inspected. Starting with a (-.3,.3) random initial weight (standardized inputs), I might get something as great as 10:1 weight rations such as (.005, ..05). With 67 hidden nodes (result of a mistake), the weight ratios are about 2:1 or (.011, .022). This net produced the best results suprisedly. But what was rather i...

Edge detection and convert edges into polygons
Hi! I need some hint on how to convert edges into vertices. What I want to do in the end is check whether a station (of which I have lon/lat values) lies within such a vertex. To be more precise: I have a netCDF file with three fields. longitude, latitude and mask, where mask has integer values and defines subregions. In this mask "image" I want to detect the edges, what I already got working using the tips on http://www.dfanning.com/ip_tips/sharpen.html. These edges I want to convert into vertices which I then put in an IDLanROI object. Using this object I could then very easily...

Algorithm to select weights on a weighted sum?
I have a model which consists of multiple predictors that output a probability between 0 and 1. These probabilities are then combined using a weighted sum. Currently these weights are fixed and have been deterimined by guesswork and trial and error. Is it there an algorithm which would allow these weights to change and adapt such that the weights give the optimum (or close to) combination of probabilities? The only way i can think of is to use a small sample of the input data and after each update of the model, modify each weight testing for a better weight for each predictor. I can see thi...

weighted mean; weighted standard error of the mean (sem)
I am looking for some reaally basic statistical tools. I have some sample data, some sample weights for those measurements, and I want to calculate a mean and a standard error of the mean. Here are obvious places to look: numpy scipy.stats statsmodels It seems to me that numpy's "mean" and "average" functions have their names backwards. That is, often a mean is defined more generally than average, and includes the possibility of weighting, but in this case it is "average" that has a weights argument. Can these functions be merged/renamed/depre...

Edge-to-edge printing with Epson 2100/2200 in PSCS
Can't seem to get this to happen. Works fine in Epson's Photoquicker but not in PSCS. Even if I choose the Maximum print area in Printer settings I get a border.... Any tips >From: "Coolasblu" noway@noway.com >Can't seem to get this to happen. Works fine in Epson's Photoquicker but not >in PSCS. ... Any tips. Works fine for me with Photoshop CS, using "Print with Preview" and setting the printer properties per the Epson data book. Check the 2200 "Printer Basics" section on "Printing Borderless Cut Sheets" for specific in...

Cap Vertical Weight Bar Storage Holder
Price:\$110.00 Image: http://thediscountdatabase.info/image.php?id=B0010XJWWI Best deal: http://thediscountdatabase.info/index.php?id=B0010XJWWI Commercial Grade Vertical bar rack; holds 9 2" Intl. Bars! ...

weighted keys
Hi, What would be an inexpensive and good MIDI-keyboard with weighted keys. It would be used in combination with a computer and soundcard, so I would ask only that it has weigthed keys and midi connectivity. thank you sf >What would be an inexpensive and good MIDI-keyboard with weighted keys. It >would be used in combination with a computer and soundcard, so I would ask >only that it has weigthed keys and midi connectivity. > Any electronic piano, maybe second-hand. A look in your local music shop will reveal which makers use keyboards to your taste, then look around. Cub...

Edge rendering
I already posted this in the Forum on the newtek site, but am getting ziltch responses... time to go back to the trusty usergroup! Hi folks, with a really important project comming up I am in dire need of a powerfull edge tracer. Lightwave's Render Edges tools have been broken for as long as I can remember and because the sharp creases doesn;t function as it should, and the lack of any adjusteablility, I am in need of something better. I have tried the Unreal Extreme celshader, without much luck, and cannot find any others. I use it for architecture, so it would be great if the lin...

The command "shaded with edges" is greyed out..... How do turn on this command? See if you have Large Assy Mode on - I think it blocks it. WT "bb" <bell@laurelnetworks.com> wrote in message news:1108676177.872898.193750@z14g2000cwz.googlegroups.com... > The command "shaded with edges" is greyed out..... How do turn on this > command? > That was it..... thanks. Wayne Tiffany wrote: > See if you have Large Assy Mode on - I think it blocks it. > > WT > > "bb" <bell@laurelnetworks.com> wrote in message >...

edge rendering
I have a dynamic network model with vertex variables and edge variables. I'd like to plot the network (graph) and "label" the edges with the plot of the time series for the corresponding edge variable. Is this possible? If so, what is the code to do this? I figure I should be using EdgeRenderingFunction, but I can't figure out how use general graphics objects for rendering. -Tim You could use EdgeLabeling as in this example: GraphPlot[{{1->2,Plot[Sin[x],{x,0,2\[Pi]}]},2->3,3->1},VertexLabeling->True] -- Stephen Luttrell West Malvern, UK "...

Hp50g Weight
Based on new user comments I took the plunge and bought one. Using a postal meter scale: 8.7 ounces for the hp50g 8.1 ounces for the 49g+ One aaa battery weighed .4 ounces so most of the additional calculator weight comes from the new battery. Randy In article <1157055573.995949.74040@m79g2000cwm.googlegroups.com>, Randy <rstaponski@yahoo.com> wrote: > Based on new user comments I took the plunge and bought one. > > Using a postal meter scale: > > 8.7 ounces for the hp50g > > 8.1 ounces for the 49g+ > > One aaa battery weighed .4 ounces so mos...

AIC with weights
In the docs, AIC is given as n ln(SSE/n) + 2 * p? Is that true with weights as well? Thanks! joseph.yarmus@ORACLE.COM wrote: > >In the docs, AIC is given as n ln(SSE/n) + 2 * p? Is that true with >weights as well? Thanks! First, let me ask you a question in turn. What are you doing that you are studying AIC values when you have weights with your data? What proc are you using, and where do your data come from, and what do the weights mean? First we need to see if you're doing the right thing... HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW ...

Survey weights?
Hello, I have a question about weighting for changes in sample size and scores. If someone could help me or direct me to a book or web page, it would be much appreciated. I conduct three surveys a year, each 4 months apart. For every survey, we survey different people, so they do not receive the survey more than once a year. A score out of 5 is recorded along with the error. At the end of the year we use one score. We take the average of the 3 scores. The sample size changes from survey to survey, in fact, it gets larger because of the growth in our database. I want to know if, at the...

broken edges
hi, I used anisotropic diffusion filter to smooth my image and then used canny to detect the contour. Any idea how to close the broken edges, so that I can fill them with holes, and apply regionprops to measure their eccentricity, solidity, and convex hull. Thanks. ...

Network edges?
If language concepts create a complex network aren't infinite, perfect, absolute, etc. just the concepts that define the edges of the network? JP JP wrote: > If language concepts create a complex network aren't infinite, > perfect, absolute, etc. just the concepts that define the edges of the > network? > JP This is what happens when a question gets too close to a conceptual network edge - whole clauses can simply disappear. -- Joe Legris jalegris@sympatico.ca wrote: > JP wrote: > > If language concepts create a complex network aren't infinite, > >...

Weight decay
All, I wish to explore using weight decay to see if this can improve the generalisation ability of my neural network which I am using for image pattern classification. I have read the neural network faq on weight decay - I now wish to implement this as simply as possible. Using the FAQ for information, the objective function which I'm trying to maximise is: Objective function = 1/(1+MSE) + 1/(sum of square weights values * small_constant); Does this seem reasonable? I appreciate that I should really be using multiple constants depending on the type of synaptic connection (input to hidd...

Smooth edges
I'm looking for advice on making borders of rounded pictures smooth. Currently when working with small images (20px) the borders have sharp edges and images looks like cutted out inaccurate. Thanks. In article <1153410390.556630.14900@s13g2000cwa.googlegroups.com>, "Dmi" <dskrizhewsky@gmail.com> wrote: > I'm looking for advice on making borders of rounded pictures smooth. > Currently when working with small images (20px) the borders have sharp > edges and images looks like cutted out inaccurate. What are you doing with these images? -- Art, phot...