Count ordered routes that visit one shop of each of four types
You need four things from four kinds of shop: a bookshop, a school-supply shop, a sports store and a stationery store. The town has many shops of each kind, joined by roads. Before searching for the shortest route, count how many ordered paths along the roads visit exactly one shop of each kind in the required order.
Explain how you count without listing every path, and the time it takes on a large town.
No answer yet. Write the first one; the best answer gets endorsed.
