Anyone up for a CS/Math/Geometry challenge?

Sharky Forums


Results 1 to 5 of 5

Thread: Anyone up for a CS/Math/Geometry challenge?

  1. #1
    Tiger Shark
    Join Date
    Feb 2001
    Location
    Satan Country
    Posts
    564

    Post Anyone up for a CS/Math/Geometry challenge?


    Here's the problem:
    Come up with an efficient algorithm to take a group of randomly placed points and create a simple polygon out of them.

    I'll define a simple polygon as a collection of non-intersecting, closed line segments which have no 'holes' in them. So, a square or a pentagon is one, but a triangle with a hole in it isn't. A simple polygon can look like lots of things, though, even a picture of your cat if it is complex enough.

    This was a problem I was given the other day, and I thought it was pretty neat, and the solution to it is even neater. I have a decent proof for it, but I need to have it looked at further to know for sure.
    ------------------
    system specs:
    Voodoo 5 5500 agp
    tyan 1834d tiger 133 dual 800eb 133mhz FSB
    via chipset 133 via apollo pro (don't make this mistake)
    256 MB RAM
    2 maxtor 60gig ata100 drives
    promise ata100 controller
    liteon 52 truex cdrom
    Linksys ethernet 10/100
    Soundblaster Live! (what's so exciting about it??) value edition
    300watt power supply (inwin)
    about 7 pounds of fans (I'm not kidding)
    Suse 7.1(god gnome is crappy compared to CDE)/win2000 based system

    [This message has been edited by bryce777 (edited September 26, 2001).]
    I'm half Scottish and half French.

    I surrender to alcohol.

  2. #2
    Cartoon Shark jester22c's Avatar
    Join Date
    May 2001
    Location
    between my headphones
    Posts
    4,372

    Post

    Not sure exaclty what kind of format you're looking for this in, if you're going to use it for programming or just theoretically.

    Store a decimal variable in accending order to each point starting with (xmin,ymix) going up to (xmax,ymax). Now you will have a list of points from bottom left to top right. This gives you a simple order to work with. Start with var1 and find point with shortest distance. Now use which ever draw function and set the limits as the coordinates. Now do the same for var2, and so on through the chain.

    ------------------
    --Proud member of the OT Forum - May it rest in peace.
    --My software doesn't have bugs, it just develops random features.
    --Error: Keyboard not attached. Press F1 to continue.
    #Download Firefox# Playing: TF2
    [Main Rig]
    [EVGA P55 SLI] [i7 860 @ 3.6] [Cooler Master Hyper 212 Plus] [8GB Corsair DDR3 1600]
    [Intel G2 80GB SSD] [MSI GTX260 OC] [NEC ea231wmi] [X-Fi > Z-Audio Lambda > Senn HD-580s]

    [Server]
    [MSI K8N Neo4 SLI] [Opteron 175 @ 2.9] [TT Big Typhoon] [2GB Corsair DDR]

  3. #3
    Hammerhead Shark hobbes2112's Avatar
    Join Date
    Jul 2001
    Posts
    1,553

    Post

    This is very much related to a Matlab Demo called the Traveling Salesman. This is in response to a larger piece of work called the Traveling Salesman Problem.

    This gets pretty heavy into optimization and neural networks. A quick search on any engine will find you lots of info.

    This is one of the cooler sites out there: Traveling Salesman

    If you have Matlab, or have access you can run the demo for yourself. I would post the source code, but I think it is copyrighted.

    ------------------
    May we never see an old friend
    With a new face.

  4. #4
    Hammerhead Shark CaTaLyST's Avatar
    Join Date
    Sep 1999
    Location
    Detroit, Mi
    Posts
    2,715

    Exclamation

    i am moving this to the programming forum.

    ------------------
    [email protected]
    ICQ: 2852628

    Contact me via email
    AIM: CaTaLyST 4131

    Heat Feedback



    My Rig:
    e8400 @ 4050, XFX 680i Tri SLI, 4 Gig OCZ DDR2, 8800 GT OC SLI, Antec 900, etc.

  5. #5
    Texan Dragon Moderator Galen of Edgewood's Avatar
    Join Date
    Sep 2000
    Location
    Ft Irwin, CA
    Posts
    5,602

    Post

    Originally posted by CaTaLyST:
    i am moving this to the programming forum.

    Bah! We already have one, CaTaLyST. :P

    I'm gonna close this one to let the other one continue.

    *click*

    ------------------
    Don't you wish that life sometimes supported Control-Z?
    Dragon of the OC Crusaders

    Break the rules and you're snack food for this dragon...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •