how to link elements with a certain probability inversely proportional to a variable

StackOverflow https://stackoverflow.com/questions/15004055

  •  10-03-2022
  •  | 
  •  

Pergunta

I have two array lists and I would like to link element from the first array to element of the second array list. Elements have a property, say A.

The condition is: an element of the first array with an high value of element.getA() prefers to link with an element of the second array with a low value of A.

I understand that for selecting an element according to a biased probability I can calculate the cumulative probabilities and then do something like this Selecting nodes with probability proportional to trust

Let's see if this is more clear: think about preferential attachment mechanism. In that case, a node links to another node with a probability which increments with the degree of the chosen node. I simply would like to hack the preferential attachment and bias the probability for a node to link another node not only on a property of the second node, but also on a property of the first node. And I want this to be inverse, like small node prefers to link big nodes and big nodes prefers to link small nodes.

Best regards, Simone

Foi útil?

Solução

[edited]

for each pair, calculate the difference (or absolute difference, or difference squared). then use that difference as weighting to select one pair.

remove pairs that are no longer valid and repeat.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top