• Home
  • Blog
  • I need computer science help to make an algorithm

I need computer science help to make an algorithm

0 comments

You live in City 0 and you want to go to City 1 then City 2 and so on until you reach City n, which is just another name for City 0. There are m different airlines that service those cities and you have created an n by n table A with airfare info. The entry A[i, j] corresponds to the airfare required to fly from City i-1 to City i on airline j. Unfortunately there are penalties for switching airlines. You create an n-1 by m by m table P containing penalty information. The entry P[i, j, k] corresponds to the penalty incurred when switching from airline j to airline k in City i. Fly as cheaply as possible .Devise an algorithm to solve this problem. It should output the total cost of the trip and display the airlines that you took to get to each city. 

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}