-- The graph contains a directed acyclic graph of edges:
-- horizontal: delete an item from a
-- vertical: insert an item from b
-- diagonal: common item in a and b
--
-- The algorithm solves dual problems in the graph analogy:
-- Find longest common subsequence: path with maximum number of diagonal edges
-- Find shortest edit script: path with minimum number of non-diagonal edges