excel file: liech sample2.xlsx
This time, for our example, we would set an imaginary trip to one city in Liechtenstein. Suppose we are planning to leave the hotel in the morning, go to an architecture object, and then lunch at a restaurant. There are several other places that we want to visit, but it was so hot that my goal in life is to make sure I get enough fun while traveling on the shortest walking distance ever. Therefore, we can formulate this to be somewhat similar to the shortest path problem.
Part I: Preparing the Raw Data
First, an imaginary route and attraction is set on the city using Depiction, properly labelled.
Then, as usual, we draw arcs using the road network.
Then the road network is exported to GML format, which then is used as a raw data on Excel.
GML is a variation of XML, which means that Excel can open it. Then, using =LEFT and RIGHT function, we have prepared data that is ready to use.
Part II: Modeling in Excel
The idea behind the shortest path problem is to let Excel solver decide which routes to take while meeting the constrains, that is, the Net Flow equal to 0. Flow is calculated by making sure that every ending point leads to another starting point. The easiest way to do so is to use =SUMIF.
In my example, I put all the available nodes on J4 to J12. Next to it, I calculate the flow: using SUMIF, I calculate how many routes leads to (J4) nodes, and whether there are equal number of routes leaving from (J4) nodes.
Last, I add the said constrains, that is the minimum fun point in order to be qualified. Then the goal is set to minimize the walking distance.
Set the solver's constrains, check on "Assume Linear Model" and "No Negative" in the Options, and the problem is solved. If you want to try it out or play around with it, I attach the excel and depiction files at the beginning of the page.
Hope this helps.
Part II: Modeling in Excel
The idea behind the shortest path problem is to let Excel solver decide which routes to take while meeting the constrains, that is, the Net Flow equal to 0. Flow is calculated by making sure that every ending point leads to another starting point. The easiest way to do so is to use =SUMIF.
In my example, I put all the available nodes on J4 to J12. Next to it, I calculate the flow: using SUMIF, I calculate how many routes leads to (J4) nodes, and whether there are equal number of routes leaving from (J4) nodes.
Last, I add the said constrains, that is the minimum fun point in order to be qualified. Then the goal is set to minimize the walking distance.
Set the solver's constrains, check on "Assume Linear Model" and "No Negative" in the Options, and the problem is solved. If you want to try it out or play around with it, I attach the excel and depiction files at the beginning of the page.
Hope this helps.