You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
@Dmitry Fedoseev , I continue to test the script, there are such solutions:
Why isn't there something like this:
Here are all the array values:
@Dmitry Fedoseev, I keep testing the script, there are such solutions:
But why isn't there one like this, for example:
Here are all the values of the array:
Because...
Because there is a variant with smaller gaps. Take a segment, from its edge look which segments start from it, if there are no starting exactly from it, then look for the closest one.
The task was to dock, and if there is no docking one, then take the nearest one.
Because...
Because there is an option with smaller gaps. We take a segment, from its edge we look at which segments start from it, and if there are no segments starting exactly from it, we look for the nearest one.
The goal was to dock, and if there is no docking, then take the closest one.
Thanks for the clarification!
In the process of implementing an idea, nuances always come up that were difficult to take into account right away.
Perhaps it can be solved in terms of graph theory. Vertices of a graph are segments and arrows of the graph connect each vertex with all possible subsequent ones (the nearest allowable segments). Each vertex and arrow is marked with weights and a rule is defined by which the weight of each path is counted. Some algorithm for finding optimal path in the graph is applied. I am not ready to investigate the question in more detail)
Or maybe a multidimensional tree. Or a ray-tracing algorithm. BSP algorithm in projection. Barin sets an interesting task, to rack your brains.