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/zenware Mar 23 '25
OSPF is closer to something like the inverse of this question in that it’s about visiting the fewest edges to reach vertex b from vertex a, and each of the vertices has some routing information that helps you achieve the goal. OP is attempting to visit the most (all) edges, trying to avoid visiting the same vertex multiple times, and the vertices provide no routing information whatsoever.