# Best Scenario (Optimization)

1 回表示 (過去 30 日間)
John Doe 2020 年 2 月 24 日
コメント済み: Walter Roberson 2020 年 2 月 25 日
Hello everyone,
I have the following table. In my colums (AA to DD) I have durations (in hrs), and the Name column tells me the location. So for example AA has to spent 148 hrs in 1A to get things done and if AA works alone it'll spend a total of 74 days (assuming it works 15 hrs/day and 7 days), the same thing for BB, etc.
Now I want to choose AA but I want to get things done in 6 weeks instead of 10.5, so I want the help of BB or CC or DD.
Visually speaking, I thought AA could spend time in specific locations spending a time of 5.9 weeks and BB in the rest spend 6.4 (a bit higher than 6 weeks) so maybe a location can be shared.
I want to try to see what scenario matlab would give me, but I don't know how to even start it.
I thought maybe a while loop could be the answer but the more I try the more I get lost. I know I want to use AA but I don't know which location would be best for it (time wise) and in which combination BB/CC/DD.
Any guidance would be appreciated. If anything is unclear please let me know
Thank you
##### 3 件のコメント1 件の古いコメントを表示1 件の古いコメントを非表示
John Doe 2020 年 2 月 24 日
Hello walter,
Thank you for the links, I looked through them and I'm honeslty still a bit lost. I thought maybe I could try to limit myself with AA and BB then check which combinations would give me shortest time. so i tired this:
a= rowAA; b= rowBB
[A,B] = meshgrid(a,b);
c=cat(2,A',B');
d=reshape(c,[],2);
but it doesn't consider if I could use only alone AA or BB for a specific location. So, my thoughts are still a bit confused
Walter Roberson 2020 年 2 月 25 日
There are some circumstances where it can make sense to "brute force" all of the possibilities -- cases where there is a definite endpoint and there are not too many possibilities.
In one sense you do not have a definite endpoint, because in theory you could try with larger and larger gaps between events being potentially scheduled. We know from our common sense that after a certain point, the results are only ever going to get worse, but the brute force approach does not know that: brute force would say that you have to evaluate all of the possibilities before deciding on the best one. Any strategy that generates possibilities on the fly and reasons that it is not worth generating more because they are sure to be worse than what you have, is effectively an Operations Research strategy. The really good Operations Research strategies can be amazingly efficient.

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by