Click here to Skip to main content
15,912,329 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionComplexity help please! Pin
password9996-Jan-10 7:25
password9996-Jan-10 7:25 
AnswerRe: Complexity help please! Pin
ProtoBytes27-Jan-10 7:24
ProtoBytes27-Jan-10 7:24 
QuestionRomanization of Japanese using the Hepburn (or related - like ISO_3602) algorithm Pin
Tom Clement30-Dec-09 14:40
professionalTom Clement30-Dec-09 14:40 
AnswerRe: Romanization of Japanese using the Hepburn (or related - like ISO_3602) algorithm Pin
ProtoBytes27-Jan-10 7:20
ProtoBytes27-Jan-10 7:20 
QuestionSnake game problem Pin
venomation28-Dec-09 11:03
venomation28-Dec-09 11:03 
AnswerRe: Snake game problem [modified] Pin
Luc Pattyn28-Dec-09 11:33
sitebuilderLuc Pattyn28-Dec-09 11:33 
AnswerRe: Snake game problem Pin
Skippums13-Jan-10 10:58
Skippums13-Jan-10 10:58 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 11:30
sitebuilderLuc Pattyn13-Jan-10 11:30 
GeneralRe: Snake game problem Pin
Skippums13-Jan-10 13:36
Skippums13-Jan-10 13:36 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 13:56
sitebuilderLuc Pattyn13-Jan-10 13:56 
GeneralRe: Snake game problem Pin
Skippums13-Jan-10 14:22
Skippums13-Jan-10 14:22 
GeneralRe: Snake game problem Pin
Luc Pattyn13-Jan-10 14:40
sitebuilderLuc Pattyn13-Jan-10 14:40 
AnswerRe: Snake game problem Pin
pewtas23-Feb-10 20:16
pewtas23-Feb-10 20:16 
GeneralRe: Snake game problem Pin
venomation4-Mar-10 1:25
venomation4-Mar-10 1:25 
QuestionGeometry problem Pin
Daniel.Sturza27-Dec-09 3:03
Daniel.Sturza27-Dec-09 3:03 
AnswerRe: Geometry problem Pin
Luc Pattyn27-Dec-09 3:10
sitebuilderLuc Pattyn27-Dec-09 3:10 
GeneralRe: Geometry problem [modified] Pin
Daniel.Sturza27-Dec-09 3:45
Daniel.Sturza27-Dec-09 3:45 
AnswerRe: Geometry problem Pin
harold aptroot27-Dec-09 4:33
harold aptroot27-Dec-09 4:33 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 5:31
Daniel.Sturza27-Dec-09 5:31 
AnswerRe: Geometry problem Pin
Luc Pattyn27-Dec-09 5:28
sitebuilderLuc Pattyn27-Dec-09 5:28 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 5:52
Daniel.Sturza27-Dec-09 5:52 
GeneralRe: Geometry problem Pin
Luc Pattyn27-Dec-09 6:10
sitebuilderLuc Pattyn27-Dec-09 6:10 
GeneralRe: Geometry problem Pin
Daniel.Sturza27-Dec-09 7:13
Daniel.Sturza27-Dec-09 7:13 
AnswerRe: Geometry problem Pin
ProtoBytes28-Dec-09 6:21
ProtoBytes28-Dec-09 6:21 
AnswerRe: Geometry problem [modified] Pin
ProtoBytes28-Dec-09 9:05
ProtoBytes28-Dec-09 9:05 
Okay I have a veague idea of what you are trying to do. Here is how I would attack it.

Daniel.Sturza wrote:
a) have the interior completely free (no segment can cross its boundaries - might touch them thou);


Use the 'Bentley–Ottmann algorithm':

Bentley–Ottmann algorithm[^]

Find the intersections of points, dump these into a point graph (tree graph, using an algorithm which indexes the roots and children, etc.), for each graph that does not cross a segment add to an 'exclusion graph'.

Next Find the max area of space occupied by exclusion graph (interior completely royalty free):

Distance transform[^]

-or-

Shoelace formula[^]

The input would be the exclusion graph's. For each graph in the stack find the largest area, add to an 'area graph'. Here you migh need to also jump to step #b first to find the correct rotation or merge this into one step.

Daniel.Sturza wrote:
b) have his sides parallel to Ox and Oy axes;


Rotating calipers algorithm[^]

This algorithm does some rotating, so I'm not sure if it is good for your (Ox, Oy) points. What are Ox,Oy? The algorithm is good for any poly or hull.


Daniel.Sturza wrote:
c) have the biggest area;


This should have been found in step a.


Daniel.Sturza wrote:
d) have the center closest to a specific point (Xref,Yref);


Jump-and-Walk algorithm[^]

This is a triangulation algorithm, my guess is that it can be adopted to your needs.

Daniel.Sturza wrote:
e) have a certain aspect ratio H/W.


No idea what aspect ratio would be. I would be using vector graphics of some sort, so the hull algorithm you are using should do this for you?!?!

Then again this is all brain storming and it might be more like 'day dreaming' Ha,ha,ha. Hope this gives you some ideas...

Another bazaar approach might be to create a Voronoi Diagram of all points, then for each segment connect the points, if the point moves through an area described by the Voronoi Diagram then remove the area from the diagram. After all points have been connected you will be left with areas excluded by the segments and then you can find the max rectangle.

Voronoi Diagram[^]

-And-

Largest empty rectangle[^]

A Fast Algorithm for Finding Maximal Empty Rectangles for Dynamic FPGA Placement[^]
~TheArch

modified on Monday, December 28, 2009 3:31 PM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.