r/computerscience • u/theron- • Mar 22 '25
City walking algorithm
NOTE: This is not a homework assignment, rather a business problem we are trying to solve for a maintenance contract in the downtown core of a major city.
Given a square grid/map of the downtown of a modern city, what is the most efficient way to walk the entire surface area of the sidewalks (two on each street, north/south and east/west) with the least amount of overlap and in the least amount of time?
Assumptions:
- a constant speed is assumed
- 4 people are available to do the walking
72
Upvotes
View all comments
Show parent comment
1
u/theron- Mar 22 '25
Two teams of two, one on each sidewalk. One team moving north/south, the other east/west. There isn't a need to return to the same place. I'd say the objective function here is to minimize travel distance i.e. time.