Question : Procedure / Script / Macro for Creation of Lists from Data Matrix

Hello,
I have data contained in square matrix. The data is the distance in meters between two locations.  I'd like to create/output lists from this data matrix based on the following scheme:

- All of the locations (the numbers in the matrix) are ranked based on "Priority Level", the .1, .2 or .3 following the number indicates priority level. Any selection between any points will need to have a distance greater than 16100.  
- I would like the lists to be created "randomly" I say I have placed randomly in quotes because I want a preference given to priority level  (i.e. 1>2>3 ).
- I don't know if this is possible, but I would like to start out by "randomly" choosing a priority 1 location and then adding as many priority 1 locations, then priority 2, and finally priority 3 locations, given that all points are greater than 16100 apart, for like 50 runs.

I don't care how the data is stored ( text file, excel, csv, etc )

Does this sound plausible to do in VB macro in excel, python or VBscript. I'd be greatly appreciative of any annotated code so that I might learn what you did.

Thank you kindly,
JE

Answer : Procedure / Script / Macro for Creation of Lists from Data Matrix

I am embarrassed to report that I failed to notice the attachment in your question. For some weird reason I tend to skip over some details. This has led as you may notice to extra frustration on my part.

To answer part of your question - "Does this sound plausible to do in VB macro in excel, python or VBscript" - Yes.

I'm still not 100% clear on what you want. "Randomly picking location "Four" would yield  the locations of 7.1, 100.3, 105.3 and 106.3". By what magic?

Let's choose location 1 as the starting point. You would take row 1 in the matrix, examine each of the other 225 columns, extract those which are > 16100 into a list.

Maybe I'm missing something, but doesn't that just amount to examining each cell in the matrix, picking those > 16100 and putting them in a list along with their coordinates? That is a total of 25312 comparisons, takes almost no compute time to rearrange the entire matrix.

If that is all you want that is trivial. Why all the concern about random and 50 runs?
Random Solutions  
 
programming4us programming4us