Cooper Larson's logo
08/24/2024  —  TSP,  Software

CesiumTSP

This is a modern TSP visualizer built with CesiumJS, Vite, TS, React, Zustand, RHF, and other robust frameworks for a highly-immersive experience.

7000 point Traveling Salesman Problem (TSP) solution demonstrated in CesiumJS

Technology Stack

CesiumJS logo
React logo
Vite logo
TypeScript logo
Zustand logo
React Hook Form logo

Motivation

The inspiration for this project came from my academic team projects leaflet visualizer. As our TSP solution progressed, the desire to see it visualized in 3D without distortion to the field-of-view grew immensely. When I started my personal TSP++ project, I knew that a custom visualizer that could render tours in 3D was a basic requirement.

Features

Tour Visualizer

A full suite of custom-designed polyline rendering and animation tools with support for backend rendering via the web-socket, perfect for 1xxx+ destination tour renderings. I plan to release the C++ cesium animation rendering tools i've built as a library in the near future.

State Management

Utilizes zustand for managing state across the app, everything from Cesium viewer state to settings form (react-hook-forms controlled form) data has it's own dedicated zustand store, this means almost no prop-drilling across the entire app.

Ball Tree visualizer

Visualize Ball Tree leaf nodes (support for selectable tree-depth range, coming soon...), incredibly useful for optimizing and debugging Ball Tree structures (ie. identifying overlapping nodes, principal component splits, density, radius and centroid bounding accuracy, etc.).

Beautiful Animations

Your tour data, always in-view. Tour fits in view? The camera flys to it and zooms in perfectly to frame the data. Global tour? The polyline animation plays, lines are re-rendered as a static line for performance, the camera then begins rotating around the Earth panning between +/- 30° latitude.

Web Socket

Communicates with a TSP backend via web socket for unmatched performance, adaptability to various backend languages and frameworks, with future plans for more advanced 'live-renderings' of large tours as they are being solved.

Performance

Built from a 'npx create-vite-app@latest' template, this project provides unmatched compilation and build performance with Vite.

Robust Code

Exclusively built with TypeScript, this doesn't contain a single .js, .jsx, .cjs, etc file. Pure .ts and .tsx aid in managing overall app complexity, for code that nearly debugs itself.

Future Plans

This project was developed completely independent from TSP++ . The C++ backend (adaptable to any other language) communicates with CesiumJS via web socket using a similar request/response interface to a RESTful API, but with future plans to implement more dynamic 'live-renderings' of a continuous optimization on a tour. Eventually, the goal is to open-source CesiumTSP with the goal of serving other curious developers who wish to tackle the Traveling Salesman Problem, but need a way to visualize it.

CesiumTSP Ball Tree Visualizer

CesiumTSP Ball Tree visualizer demonstration