Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help Writing an Algorithm

조회 수: 1 (최근 30일)
MKM
MKM 2025년 6월 7일
마감: John D'Errico 2025년 6월 8일
Hello,
Looking for some pointers on the best way to go about this. I have a tasking app that will load all tasks upon launching the app.
Im looking for it to sort the tasks using an algorithm that will put the most important task at the top.
Each task has its own rating from 1-5 (1 being not so important, 5 being very important), when its due by and who raised the task. A task can only be performed on certain days based on what day it is (i.e. Mon-Thurs for certain tasks and only weekends for others).
What is the best way to sort this? Should i create some type of weighting system where if its during the week rate a task 3/5 important and then based on its own rating sort it again? should the weight system be out of 100? should it be percetile? Not sure the best way to go about this.
Cheers.
  댓글 수: 3
the cyclist
the cyclist 2025년 6월 7일
Just to expand a bit on what @Walter Roberson wrote:
There is a difference between the algorithm and the code to perform the algorithm. The algorithm is the (unambiguous) sequence of instructions that will solve the problem. The code carries out those instructions.
Generally speaking, this forum tends to be more about helping with the code in MATLAB (although certainly folks help with algorithmic ideas, too). But in your case, I think you are really the only one who can decide on the algorithm. A first step, which I think you know already, is to list all the variables that could be used to define the priority. Next, you need to decide on the formula that calculates the priority from those variables. Then, you encode that formula.
These days, I expect that ChatGPT or another AI could help with that formula-definition task, more efficiently than we could. You could try to "AI Chat Playground" here, for example.
John D'Errico
John D'Errico 2025년 6월 7일
편집: John D'Errico 2025년 6월 7일
This is far too vague of a question to even be thinking about an algorithm, not even considering code. And that makes it not even a question about MATLAB, certainly not yet.
But then you ask very specific questions about weights. Shoould they be out of 100? Who cares? Weights are always going to be relative, however you implement them. 100 is just a number. That suggests you are getting lost in the specifics, without even thinking about the real questions.
You need to write down, very clearly what are the goals. What are you trying to solve? What makes the problem solvable, such that there is a solution? Will you minimize something? Maximize something?
What are the unknowns? Again, be clear. WRITE IT DOWN. Do so in a way that someone can understand your question. In what form are the unknowns defined?
Are there constraints on the problem that limit it in some way? It is often the case that whollty unconstrained problems have no solution.
I'm sorry, but all of this is something that only you can do, since only you know what problem you are trying to solve. Until you can define the problem with sufficient accuracy, you cannot formulate an algorithm in any form.
You may need to sit down with a specialist in a field like operations research, where you will explain what you must do, and they can point you in a reasonable direction.

답변 (0개)

이 질문은 마감되었습니다.

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by