Question: Write a C program to solve the two room weighted interval scheduling problem by using dynamic programming. The first line of the input will be

 Write a C program to solve the two room weighted interval

scheduling problem by using dynamic programming. The first line of the input

Write a C program to solve the two room weighted interval scheduling problem by using dynamic programming. The first line of the input will be the number of intervals (n) and each of the remaining n lines have three non-negative integers (si, fi, vi) for the start time, finish time, and weight for an interval. n will not exceed 50. The intervals will be ordered by ascending finish time.

Goals: c. d e. 1. Understanding of the dynamic programming solution to the one room) weighted interval scheduling problem. 2. Understanding of the five steps for developing a dynamic programming solution. Requirements: 1. Your task is to write a C program to solve the two room weighted interval scheduling problem by using dynamic programming. The first line of the input will be the number of intervals (n) and each of the remaining n lines have three non-negative integers (Si. fi. vfor the start time, finish time, and weight for an interval n will not exceed 50. The intervals will be ordered by ascending finish time. You should echo the input 2. You should print your dynamic programming table() with appropriate labeling, 3. Your solution should be formatted as: A line with just the number of intervals assigned to the first room b. A line for each of the intervals assigned to the first room: start time, finish time, weight. A line with just the number of intervals assigned to the second room. A line for each of the intervals assigned to the second room: start time, finish time, weight. A line with the total weight that has been achieved and appear at the end of your output. No particular ordering of the intervals is required 4. Submit your program on Canvas by 12:45 p.m. on Monday, March 22. One of the comment lines should include the compilation command used on OMEGA (5 point penalty for omitting this). Getting Started: 1. The input should be read from standard input (which will be one of 1. keyboard typing, 2. a shell redirect (9 from a file, or 3. cut-and-paste). Do NOT prompt for a file name! Do not use geta (). 2. All output should go to standard output. 3. Your solution must use dynamic programming to maximize the total weight of the intervals assigned to the two rooms The intervals assigned to a room may not overlap (two intervals / and / overlap if either $; . The only issue is: Should intervall be placed in room one

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!