HomeAlgorithms & AIWeighted Edit Distance: Cost Landscape & Alignment Path

Weighted Edit Distance: Cost Landscape & Alignment Path

Interactive 3D dynamic-programming cost landscape for the weighted edit-distance problem: tune insertion, deletion and substitution costs (plus optional Damerau transposition) and watch the optimal alignment path bend across the DP surface in real time.

Algorithms & AI3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
dynamic-programming-edit-distance ↗ Open standalone

Every pair of strings has a dynamic-programming cost matrix hidden inside it: a grid where cell (i, j) holds the minimum cost to turn the first i characters of one string into the first j characters of the other. This simulator renders that matrix as a real 3D bar landscape, colours each bar by its accumulated cost, and traces the actual optimal alignment path — the exact sequence of insertions, deletions, substitutions and (optionally) adjacent-character transpositions — as a glowing line through the surface. Sliders let you set independent, asymmetric costs for each operation type, and the whole landscape and path recompute live, showing how the cheapest edit sequence bends when one kind of edit becomes more expensive than the others.

⚙ Under the hood

Explore the weighted edit-distance dynamic-programming table as a 3D cost landscape: tune independent insertion, deletion and substitution costs (plus optional Damerau transposition) and watch the optimal alignment path bend live across the surface.

dynamic programmingedit distancelevenshteinsequence alignmentalgorithmsstring matching

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)