dynamic programming man power planning
-
i am trying a dp solution for this classical manpower sharing problem. you can find the problem description at: http://www.spoj.pl/problems/MKBUDGET/ i can able to calculate for last month. i cant able to proceed to other months in bottom up approach. any help would be appreciatable. Thanks.
-
Answer:
Just had a quick think for you ... sounds right in 30 second look ... The key is to compare the number you need next month and if you drop and you need at least the same lower amount or less 2 months later then you shed. Something like: Hire this month. Is increase next month? Hire. Is same next month? Do nothing. Is less in next, next next month? Sack. Make next month this month. Repeat.
javasoul at Stack Overflow Visit the source
Other answers
You're trying to calculate the total salary, s[m][t], up to month m, with t temps at the end that month. Initially, you have s[0][0] = 0. The total salary for the next month will depend on: The total salary up to the month before. The number of temps needing to be hired or terminated. The salary of all the temps currently working. If there are 10 temps needed for the first month: the first thing that would happen is hiring the initial temps so there's a transition from s[0][0] to s[1][10], where s[1][10] = s[0][0] + 10*hireCost + 10*salaryCost.
fgb
Related Q & A:
- How To Be Sexy Man?Best solution by Yahoo! Answers
- How to serialize an object to XML with dynamic element's attribute?Best solution by Stack Overflow
- How to Convert a Procedural Programming into Object-Oriented Programming?Best solution by Stack Overflow
- Why is Pac-man called Pac-man?Best solution by answers.yahoo.com
- Im planning to travel in canada with the invitation coming from my daughter married with a canadian man?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.