Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design and Analysis of Algorithms ( COM 3 3 6 ) Second Semester 2 0 2 3 / 2 0 2 4 Project # 1

Design and Analysis of Algorithms (COM336)
Second Semester 2023/2024
Project # 1
Optimal Strategy for Minimum cost from city1 to city1 using Dynamic Programming
Write a program that solve minimum cost for traveling from city 1 to city 2 Problem using Dynamic Programming technique.
Problem definition:
Travelling from home in city1 to a hotel in city2.
N stopovers on the way
a. a number of choices of towns for each stop,
b. a number of hotels to choose from in each city.
Each trip has a different distance resulting in a different cost (petrol).
Hotels have different costs.
The goal is to select a route to and a hotel in city 2 so that the overall cost of the trip is minimized.
Your program should print out the following:
Read the input data from a file
File format:
Number of cities
Start city, end city
List of adjacent cities
Example:
Petrol cost
Hotel cost
14
Start, End
Start, A,22,70
B,8,80
C,12,80
A,[D,8,50],[E,10,70]
B,[D,25,50],[E,10,70]
C,[D,13,50],[E,13,70]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions