DIR Return Create A Forum - Home
---------------------------------------------------------
techsuns
HTML https://techsuns.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Programming Questions
*****************************************************
#Post#: 284--------------------------------------------------
select the activities
By: dinesh Date: November 30, 2012, 4:08 am
---------------------------------------------------------
You are given n activities with their start and finish times.
Select the maximum number of activities that can be performed by
a single person, assuming that a person can only work on a
single activity at a time.
Consider the following 6 activities.
start[] = {1, 3, 0, 5, 8, 5};
finish[] = {2, 4, 6, 7, 9, 9};
The maximum set of activities that can be executed
by a single person is {0, 1, 3, 4}
#Post#: 330--------------------------------------------------
Re: select the activities
By: ravu Date: December 4, 2012, 10:09 pm
---------------------------------------------------------
the method is to find all possible independent sets, like for
example
In our case we have a loop
possible set - {(1,2),(3,4),(5,7),(8,9)},
{(3,4),(5,7),(8,9)}
{0,6},(8,9)} and {(5,7),(8,9)}
maximum is the first set.
#Post#: 336--------------------------------------------------
Re: select the activities
By: dinesh Date: December 4, 2012, 11:45 pm
---------------------------------------------------------
how do you implement it?
can you give pseudocode or outline of the method ?
Mention which paradigm you are using...
#Post#: 341--------------------------------------------------
Re: select the activities
By: dinesh Date: December 5, 2012, 3:22 am
---------------------------------------------------------
@ravu - your solution is using brute force approach
try to use greedy approach
#Post#: 388--------------------------------------------------
Re: select the activities
By: kpr29 Date: December 10, 2012, 11:32 am
---------------------------------------------------------
@Majeti:Dynamic Programming + Greedy Approach for getting the
maximum value........
kp.
#Post#: 397--------------------------------------------------
Re: select the activities
By: dinesh Date: December 10, 2012, 11:01 pm
---------------------------------------------------------
can you explain how to use the paradigms...
*****************************************************