Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an first primary polyline with a large number of point.
Then I have a second polyline with a smaller number of point. The second polyline derives from the first through an optimization (es. Ramer-Douglas-Peucker algorithm or something other).
I need to evaluate how good is the optimization (that is to know how similar is the second polyline in comparison with the first) in the fastest way possible.
By doing this I'll be able to compare different optimization algorithms but I need to do it without taking too much time.
Thanx for any help
Posted
Comments
Patrice T 3-Sep-15 12:11pm    
What have you tried so far ?
Patrice T 3-Sep-15 12:14pm    
How do you define similarity ?
How do you compare 2 algorithms ?
Patrick70__ 4-Sep-15 3:43am    
I've been thinking about comparing the areas of the two polyline but that's not very smart.
Obviously you are not to compare two algorithms but the results so the two polylines.
Patrice T 4-Sep-15 6:08am    
Try to draw a square as primary polyline and a star as a secondary polyline and try to device a method to compare the 2 and to size the differences.
Sergey Alexandrovich Kryukov 3-Sep-15 13:00pm    
First of all, it has nothing to do with WPF, this is pure mathematical calculation over the line data. Give the strict mathematical definition of "difference" (there is no any default meaning of such thing), and then the implementation won't be any difficult.
—SA

1 solution

There is no solution to your question the way you ask it.

Sergei is right when he says
Quote:
You are not ready to solve such problems, because you have no clue on how to define the problems.


First rule of programming: You have to master the problem well enough to explain the computer what to do. It is mandatory because the computer is fast but stupid, he will never guest something.

Advice: Try to solve the problem by hand.
Take a set of arbitrary polylines, some regular, others non regular.
Take a sqare, a rectangle, a cross, a triangle, a star, a pentagon, an hexagon, a horse shoe ... , and you can play with sizes.
Pick one shape and check it against the others graphically and choose the best one. repeat many time, until you have defined the rules for the best answer.

Your definition of best choice will make a new set of problems to solve.
 
Share this answer
 
v2
Comments
Patrick70__ 7-Sep-15 2:51am    
OK... I'll be back..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900