Jump to content

Node Chunk Swapping in a Network

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Kleptine

Kleptine

    Newbie

  • Members
  • Pip
  • 1 posts
So I'm using a node network to organize data in a project I'm working on. I'm trying to find an algorithm to randomly combine two different networks such that the structure remains most in-tact, without creating infinite loops or dead nodes. The networks can have any number of nodes, but will have the same number of input and outputs. Right now the algorithm picks a random chunk and tries to swap it with a random chunk of the other network, however I'm having difficulties coming up with an algorithm that will swap the chunks while maintaining as much of the node structure as possible. Any help?

Here's an example of two networks with random chunks that it tries to swap. At the moment the algorithm just distributes input/output links to random nodes in the chunks but that can easily create infinite loops.
http://i.imgur.com/KrFE1.png

Thanks, I'm looking for any advice on how to accomplish the task or anything information related to node/network use.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I think your first problem is you haven't defined how to do that well.

When I look at the image you linked, I note that there is one connection to the green node on the right, but it increases to two after the swap. It seems like you're preserving the number of links in the swapped nodes, rather than the static nodes. If that's a goal, you need to state it clearly. It also appears that you're dealing with a digraph, as opposed to a non-digraph, and that you have the goal of not having more than one connection between any two nodes. In that case, you will have to analyze the maximum number of connections into a swapped piece and ensure that many nodes are selected from the piece it will be swapped with.

Overall, you really need to define your constraints more precisely. Once you've done that, it will probably become more obvious how to perform the swaps, or detect when they're not possible.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users