Algorithm for combining ranges of a segment - help to create - page 4

 
google"the travelling salesman's task".
 
Олег avtomat:
Look up"the travelling salesman's task" on Google

There's a different challenge there.

 
Aleksey Vyazmikin:

There's a different challenge there.

Of course, it's a little different. Especially since you haven't even formulated your problem properly.

Look at the solution methods.

 

About the travelling salesman's problem:

.

 
Олег avtomat:

Of course, it's a little different. Especially since you haven't even formulated your problem properly.

Look at the solution methods.

What point is missing in the formulation? Dimitri found a solution based on the conditions of the problem, he seems to have got it right.

Oleg avtomat:

See methods of solution.

The question is not the method of solution at the first stage, but the adaptation of the initial data to the same as in the classical problem.

There are different methods, I am not an expert in them, so if there is an idea which of the methods can be adapted, then report, we will look and think.

 
Aleksey Vyazmikin:

What point is missing from the wording? Dmitri found the solution based on the conditions of the problem, it seems to have understood everything correctly.

The question is not in the method of solution at the first stage, but in the adaptation of the initial data to similar, as in the classical problem.

There are different methods, I am not an expert in them, so if there is an idea which method can be adapted, then report, we will look and think.

Alexey, where is it?

You, solving the problem, reached the first level of abstract understanding and immediately hit a wall.

The segments... What if they're sections of a circle?

Why don't you formulate the problem here? While it's the weekend)))

 
Find the shortest/longest path between two points in the graph. Only here there can be several starting points and several ending points.
Only the graph is oriented
Recursively go through the whole graph keeping the best path...
 
Алексей Тарабанов:

Alexei, where is it?

There - in the solutions of the problem about the traveling salesmen on the Internet.

Alexei Tarabanov:

You, solving the problem, reached the first level of abstract understanding of it and immediately hit a wall.

Tell me more, I don't understand the idea.

Alexei Tarabanov:

The segments... What if they are sections of a circle?

Suggest a solution with circles - I'm intrigued.

Alexei Tarabanov :

Maybe you can formulate the problem here? While it's the weekend)))

What problem? The essence of the problem I have laid out for you personally above.

 
Aliaksandr Hryshyn:
Search for the shortest/longest path between two points in a graph. Only there can be several starting points and several ending points.
Only the graph is oriented.
Recursively go through the whole graph keeping the best path...

Here the shortest/longest path should be determined not only by the proximity of two segments, but also by their value. It's like adding the number of population in each city to the traveling salesmen problem, and also the condition that you can't go back in the direction of the previous movement.

 
Aleksey Vyazmikin:

1. Above, Alexei Tarabanov wrote in detail where and in what when answering. But it's a theory - I haven't really finished what I need yet.

It's clear then - I haven't figured it out and just ran two scripts - if the set is different, you can only evaluate if the sets are the same.

2. I think the third item is a better option. Could you tweak the code to make it work correctly with this implementation?

All right, originally I wrote about all combinations, but in the process, thanks to you, it becomes clear that it's very expensive and we need an option which is empirically capable of being as good as complete brute force, and since evaluation of resulting segment is formed from its chunks, so I assume that by limiting n combinations from best chunks and adding new one, we can get closer to best option from all possible combinations without limit.

1. Completely incomprehensible and already something quite different.

2. I'm kind of lazy, I'm not in the mood. Do it yourself. There are three two-dimensional arrays declared in the SAllVariants structure, with size 2 on the second dimension. We need to change 2 to 3 there, and wherever there is an assignment in the 0-th and 1-th elements, add an assignment in the 2-th.

What is the task in general? What is the practical purpose? Maybe it is solved in a different way.

Reason: