I have a list of nodes-NodeList(each of them is different). and i has a number-N
Here we want to select some nodes as candidate from the list(needed more than half).
Is there any algorithm to achieve this goal. There are some tips:
1. same N(we call it seed), same selection result
2. the number of candidate must be more than half of the list size
3. different seed, different result(as far as possible).
For example:
List of nodes(NodeList) : [nodeA, nodeB, nodeC,...,nodeZ], the size of NodeList is 26. Each of node is a address(in akka, you can image it is a string).
And i need a algorithm.
Input:
- Seed: a number(int)
- NodeList : List of nodes
Output: - NodeListResult: according to the seed, we select some nodes from NodeList. maybe [nodeA, nodeB, nodeD, ..., nodeZ]. The size of NodeListResult must be greater than the half of NodeList's size.