Minimum Distance Problem

ciaran3

New Member
Joined
Apr 24, 2015
Messages
8
I really haven't progressed far in this myself as I'm not exactly sure about the best way to go about solving it (so no code really done on my end).

I have two unique sets (let's call them Set A and Set B) of 90 locations. Each of these two sets is further subdivided into 30 subsets of 3 locations each. Each of these locations is defined by a name which I am then using to pull a zip code that will then define that location and pulling the latitude and longitude of each zip code. This part is working correctly.

Each subset of 5 ties to another subset of 5 locations from the other grouping of 100 (eg 1A, 2A, 3A are going to be grouped with with 1B, 2B, 3B). I want to assign one location from group A to a location in group B such that the total distance traveled for each subset of 4 is minimized (eg 1A to 2B, 2A to 3B, 3A to 1B). I want to wrap this all up in nice VBA code so that someone just has to click play and it finds the minimized distance for each of the 30 subsets.

Right now, the only way I can see to solve it doesn't involve solver (because it has to pick from a named location as a variable cell) but actually solving for each distance combination and then finding the one that allows the smallest distance. That seems extremely clunky to me and just wanted to see if someone might have a better thought process.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top