Jump to content

Search algorithm, (about the same as Toady with a twist)


Recommended Posts

Im trying to do somewhat the same as Toady have done (great stuff), but his code have expanded into something thats just way to big for what i need. And im trying to connect the "path" with connections.

Simple example on what i want to do:

some code first:

ID1:Connected to ID3,ID6,ID2

ID2:Connected to ID4,ID6,ID1

ID3:Connected to ID1,ID9,ID6

ID4:Connected to ID2,ID9

ID5:No connnections

ID6:Connected to ID1,ID2,ID3,ID9

ID7:No connnections

ID8:No connnections

ID9:Connected to ID3,ID4,ID6

A few hours ago i knew just what i should do here, but now iwe been tumbling with all kinda stuff and i just cant see how i would do it.

Goal is going from ID1 to ID9

Route1 ID1 --> ID3 --> ID9

Route2 ID1 --> ID6 --> ID9

Route3 ID1 --> ID2 --> ID4 --> ID9

Route4 ID1 --> ID2 --> ID6 --> ID9

... well i could go on creating all kinda routes here :rolleyes:

Anyone have any good idea?

All help appreciated :rambo:

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Im trying to do somewhat the same as Toady have done (great stuff), but his code have expanded into something thats just way to big for what i need. And im trying to connect the "path" with connections.

Simple example on what i want to do:

some code first:

ID1:Connected to ID3,ID6,ID2

ID2:Connected to ID4,ID6,ID1

ID3:Connected to ID1,ID9,ID6

ID4:Connected to ID2,ID9

ID5:No connnections

ID6:Connected to ID1,ID2,ID3,ID9

ID7:No connnections

ID8:No connnections

ID9:Connected to ID3,ID4,ID6

A few hours ago i knew just what i should do here, but now iwe been tumbling with all kinda stuff and i just cant see how i would do it.

Goal is going from ID1 to ID9

Route1 ID1 --> ID3 --> ID9

Route2 ID1 --> ID6 --> ID9

Route3 ID1 --> ID2 --> ID4 --> ID9

Route4 ID1 --> ID2 --> ID6 --> ID9

... well i could go on creating all kinda routes here :rambo:

Anyone have any good idea?

All help appreciated :x

I'm not sure, but this sounds like the "tree or loop" problem I saw more than a year ago. It was one of my earliest AutoIt scripts and taught me a lot: Determining Trees With Autoit: _LoopDetect()

Hope that helps!

:rolleyes:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Yeah, right on the head!

Thanks :rolleyes:

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...