Class RiverTravel

java.lang.Object
topics.dynamic.RiverTravel

public class RiverTravel extends Object
DYNAMIC PROGRAMMING PROBLEM: CHEAPER TRAVEL ON THE RIVER It consists on finding the minimum cost for each pair of points
Author:
vicegd
  • Constructor Details

    • RiverTravel

      public RiverTravel()
  • Method Details

    • riverTravel

      public void riverTravel(int[][] t, int[][] c)
      The dynamic programming version has a cubic complexity O(n^3)
      Parameters:
      t - Initial matrix of fees
      c - Final matrix of minimum cost for each pair of docks
    • writeMatrix

      public void writeMatrix(int[][] a)
      Prints one of the matrix
      Parameters:
      a - Calculated matrix