Finding Shortest Paths
Given an m x n matrix of integers, structure a program that
computes a path of minimal weight. The
weight of a path is the sum of the integers in each of the n cells
of the matrix, that are visited. A path
starts anywhere in column 1 (the first column) and consists of a
sequence of steps terminating in column n
(the last column). A step consists of traveling from column
i to column i + 1 in an adjacent (horizontal or
diagonal) row. For example, a 5x 6 matrix and its shortest path are
shown below:
תU 5 4 2 8 6 6 1 8 2 7 4 3 93 9 5 00 8 4 3 2 6 3 7 2 8 6
Finding Shortest Paths Given an m x n matrix of integers, structure a program that computes a path of minimal weight. Th
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am