Closed Thread
Results 1 to 3 of 3

Thread: Most efficient way to do this? (An invasion problem)

  1. #1
    XZhang is offline Newbie
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Most efficient way to do this? (An invasion problem)

    Hi,

    Consider the following:

    -I have a big two dimensional array of points (a square lattice).
    -Each edge between points is assigned a value between 0 and 1 at random, call it the 'value' of the edge
    -I start at some point in the middle. I consider the edges connecting to all adjacent vertices, and whichever has the least value, I add the point it joins to to my set.
    -I repeat this process.

    So at each step, I need to check the values of all the edges from points in my existing set, except those that joint to another vertex in my set.

    I would like this to be as quick as possible... what would be the best way?

    Just checking the edges from EVERY point in the existing set becomes very slow as the number of points in the set increases, nor should it be neccessary, considering that at each step we're only adding one more point, which will not affect the permissible adjacent points for most of the points in the graph...

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    bobdark's Avatar
    bobdark is offline Programmer
    Join Date
    Jan 2010
    Location
    Haifa, Israel
    Posts
    164
    Rep Power
    9

    Re: Most efficient way to do this? (An invasion problem)

    Please provide some additional clarifications:
    1) What does represent array[i][j]? Some point? If so then what fields does the point have? Or maybe it represents the value of the edge between points i and j?
    2)How do we know the value of an edge connecting two points??
    3)Do you have memory limitations? Upper bound for memory complexity?
    4)Do you want code or an algorithm?

  4. #3
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Most efficient way to do this? (An invasion problem)

    Are you just trying to find the minimal spanning tree?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ulat Bulu Invasion, my first 3d game :)
    By mirwanda in forum Member Software/Projects
    Replies: 10
    Last Post: 01-20-2012, 12:07 PM
  2. Ulat Bulu Invasion, my first 3d game :)
    By mirwanda in forum Games
    Replies: 1
    Last Post: 05-30-2011, 01:09 AM
  3. Is this efficient?
    By Bull3t09 in forum C# Programming
    Replies: 1
    Last Post: 10-26-2010, 08:14 AM
  4. ISP invasion
    By chili5 in forum Technology Ramble
    Replies: 36
    Last Post: 04-22-2008, 11:06 AM
  5. MP4 Invasion.. but no one knows what they are?
    By GMailGuy in forum Technology Ramble
    Replies: 2
    Last Post: 11-05-2007, 06:31 AM

Tags for this Thread

Bookmarks

Posting Permissions

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