question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About the algorithm-problem relationship

See original GitHub issue

I’m opening this issue to start the discussion about the algorithm-problem relationship.

My point of view is the following. An Algorithm in jMetal is a metaheuristic, so it is intended to solve a given problem, so I included the relationship “Algorithm solves Problem” in the class diagram.

On the other hand, the interface Algorithm does not make any reference to problems:

public interface Algorithm<R> extends Runnable, Serializable {
  public void run() ;
  public R getResult() ;
}

However, if we deep into the class hierarchy, all the Builder classes to configure and instantiate algorithms have one mandatory argument: the problem (I discussed about this with Matthieu in another issue), so the relationship Algorithm-Problem is in the code.

I agree that my view is very biased, because the concepts are clear to me.

We have several ways to proceed:

  • Do nothing
  • Consider renaming Algorithm as `Metaheuristic´, as in the former versions of jMetal. This vay, the relationship is implicit given the definition of what a metaheuristic is.
  • Change the Algorithm interface. For example, a void setProblemToSolve() could be added, or the run() method could be changed to solve(Problem). Here, I like the run() method because it allows to run the algorithm in a thread, as Matthie suggested.

This discussion also applies to the relationship “Algorithm uses Operators”.

I’m open to suggestions about the most convenient way to proceed.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:38 (36 by maintainers)

github_iconTop GitHub Comments

1reaction
matthieu-vergnecommented, Feb 25, 2017

Considering that a significant part of the discussion was about parameters of the algorithm which need to be set at various times depending on the context, would you be interested to have setter/getters for each parameter? The idea is to be able to set them whenever we need/want before the execution of the Algorithm. If the Algorithm is coded for it, it is also possible to change the parameters during the run, like required in #185.

0reactions
matthieu-vergnecommented, Feb 26, 2017

I am currently working on the experiment architecture. It is well advanced, but not finished yet (I don’t have a full experiment ready yet). I will present it in #135 when it will be complete, but so far it does not depend on the dependency between algorithms and problems (they can be completely independent or completely coupled, it works anyway) because it requires only the algorithm (the problem can be used in any way, the experiment architecture is oblivious to it). This way, it offers a lot of flexibility, so we can use it already with the current jMetal architecture, and even if we revise the dependency between algorithms and problems it should not impact the architecture of experiments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Algorithm Problem Solving Approach in Psychology
Algorithms are often used in mathematics and problem-solving. Learn more about what an algorithm is and how it compares to other strategies.
Read more >
Relationship between problem and algorithm | R Data ...
Problem can be defined as the task to be performed. The execution of the task to be performed can be divided primarily into...
Read more >
Algorithmic Problem Solving for Father-Daughter Relationships
In designing an algorithm, a person can execute a complex task through observation and analysis. To be a good father, it would be...
Read more >
Would you let an algorithm manage your relationships? - BBC
There are few aspects of our lives that are not influenced by algorithms. But would you let one manage your relationships with other...
Read more >
4. Problem Solving and Algorithms - Sofia
What relationships exist among the data values? ... An algorithm is a plan for solving a problem, but plans come in several levels...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found