Optimal algorithm for scanning servers.

  • Thread starter Thread starter noelo2014
  • Start date Start date
  • Tags Tags
    Algorithm Scanning
AI Thread Summary
The discussion revolves around developing an algorithm to determine which servers from a list of IP addresses are most likely to be online based on two datetime values: the last known online time and the last connection attempt time. The user clarifies that the focus is not on sorting algorithms but on establishing a method to prioritize connection attempts. They propose a general rule: if the last connection attempt was recent and the server's last online time was not, the server is likely offline. Conversely, if the server was last online recently and the connection attempt was older, it is more likely to be online. The user hints at the potential for a mathematical formula to refine this approach and considers seeking further insights in a mathematics-focused forum.
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...
 

Similar threads

Replies
4
Views
2K
Replies
1
Views
1K
Replies
29
Views
3K
Replies
3
Views
3K
Replies
2
Views
2K
Replies
11
Views
3K
Replies
2
Views
1K
Back
Top