0

I want to create a graph to represent a network.

Each node can be of 3 types: A, B, and C.

I have an initial probability distribution that says that each node in the network has a certain probability of being: A, B, or C. However these probabilities work in a specific way, this translates into: I have x nodes of type A, the rest being of type B or C. Then among the rest, y are of type B and the rest are of type C.

I have no problem allocating type A. My problem is with allocating type B then C.

My problem is the following: I first allocate type A with the corresponding probability, what I want to do next is that each neighbor of a node A has to have a probability y of being B.

How can this be done? I believe that while iterating on each node A and allocating its neighbors with type B, these neighbors can also be neighbors of another node A, so it can mess up the probability distribution among the neighbors of the other A node.

Can you provide me with a pseudo-code or an explanation of how the allocation of classes can be done?

Thank you

Adonis320
  • 61
  • 7
  • 1
    1) Allocate all the A-nodes; 2) List all the neighbours of A-nodes, without repetition; 3) Allocate the B-nodes in that list. – Stef Aug 23 '21 at 08:38
  • @Stef, will this preserve the probability distribution among neighbors? (the neighbors of a node A can be the neighbors of another node A) – Adonis320 Aug 23 '21 at 08:45
  • Your requirements are not consistent. You cannot have "y are of type B" AND "each neighbor of a node A has to have a probability y of being B" In the first y is a number greater than 1, while in the second y is a probability ( less than 1 ) – ravenspoint Aug 23 '21 at 18:33

0 Answers0