Re: [R] Shortest connected path in a matrix

2014-03-10 Thread MacQueen, Don
This might be done using GIS tools, where finding shortest paths between locations is a common task. But I can't help with details. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/5/14 9:44 AM, McCloskey, Bryan

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread McCloskey, Bryan
Here is some example data (hopefully the monospace formatting is preserved): a b c d e - - - - - 1 | F | T | F | T | F | - - - - - 2 | T | F | T | F | T | - - - - - 3 | T | T | F | F | F | - - - - - 4 | F | T | F | T | F | - - -

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread Bert Gunter
(Mod my ignorance) This appears to be computer science/math problem and has nothing specifically to do with statistics nor R. So I suggest you post on a more appropriate venue rather than here. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread Suzen, Mehmet
You may want to check bioconductor packages doing graph algorithms. Maybe this one: http://www.bioconductor.org/packages/release/bioc/manuals/RBGL/man/RBGL.pdf See for example ?dijkstra.sp On 5 March 2014 18:44, McCloskey, Bryan bmcclos...@usgs.gov wrote: Here is some example data (hopefully

[R] Shortest connected path in a matrix

2014-03-04 Thread McCloskey, Bryan
I have a binary rectangular T/F matrix; I need to be able to calculate the shortest path (i.e., Pythagorean distance) between a populated cell in row j and any populated cell in some row j+n. For instance, if I have a chessboard with random black/white square colors, I need the shortest distance