A time-traveling route planner that lets you journey between cities while always departing and arriving at the same local time.
Infinite Lunch solves a unique variant of the Traveling Salesman Problem (TSP) where the goal is to visit a sequence of cities while always departing and arriving at the same local time. By leveraging time zone differences and setting velocity constraints, you can create continuous loops where it's always the same time of day at each stop.
- Select cities from around the world
- Set time shifts to adjust arrival/departure times
- Define minimum and maximum travel speeds
- Visualize optimal routes on a map
- Calculate total journey duration
- Clone this repository
- Set up the development environment:
nix develop
- Fetch required city data:
fetch-data
- Install dependencies:
npm install
npm run start
npm run build
npm run deploy
The application:
- Calculates distance matrices between cities using the Vincenty formula
- Generates time matrices based on timezone differences
- Applies your specified time shift to create duration matrices
- Computes travel speeds between city pairs
- Filters connections based on minimum/maximum velocity constraints
- Solves the TSP using a MiniZinc constraint programming model
- Returns optimal routes that maintain the same local time at arrival/departure
- Built with TypeScript and Vite
- Uses OpenLayers for mapping
- Leverages MiniZinc for constraint solving
- Calculates geodesic distances with the geodesy library
- Handles timezone calculations with Luxon