Optimal algorithm for scanning servers.

  • Thread starter Thread starter noelo2014
  • Start date Start date
  • Tags Tags
    Algorithm Scanning
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
noelo2014
Messages
45
Reaction score
0
I'm writing a piece of software and need to find an optimal algorithm for scanning servers. Basically I'm given a list of N IP addresses, each IP address has two associated datetime values: The time the server was last known to be online and the time of the last connection attempt.

Given these values I need to sort the list so the servers most likely to be online right now are at the top of the list.
 
Physics news on Phys.org
For sorting lists take a look at qsort I believe its nLogn and a lot of languages have built in functions for it :)
 
I don't think you understand my question. I'm not concerned with sorting algorithms, I need a way of choosing which server to attempt to connect to based on the last time it was online and the time I last tried to connect to it.

I think I have it figured out though. As a general rule, if the (time I last attempted to connect)* was recent and (the time the server was last online)* was not, then it's unlikely this server is online.
If the situation is reversed then it's more likely the server is online right now.

* these times are relative to the max/min in each of these sets



I'm sure there's some mathematical formula that applies to scenarios like this. that's why I posted it in the maths programming forum, maybe I'll re-post in the maths forum! probably probability...