A social group is represented by a graph, where each pair of nodes is connected by two oppositely directed links. At the beginning, a given amount p(i) of resources is assigned randomly to each node i. Also, each link r(i,j) is initially represented by a random positive value, which means the percentage of resources of node i which is offered to node j. Initially, the graph is fully connected, i.e., all nondiagonal matrix elements r(i,j) are different from zero. During the simulation, the amounts of resources p(i) change according to the balance equation. The nodes reorganize their activity with time to give more resources to those which give them more. This is the rule of varying the coefficients r(i,j). The result is that after some transient time, only some pairs (m,n) of nodes survive with nonzero p(m) and p(n), each pair with symmetric and positive r(m,n)=r(n,m). Other coefficients r(m,i≠n) vanish. Unpaired nodes remain with no resources, i.e., their p(i)=0, and they cease to be active as they have nothing to offer. The percentage of survivors (i.e., those with p(i) positive) increases with the velocity of varying the numbers r(i,j), and it slightly decreases with the size of the group. The picture and the results can be interpreted as a description of a social algorithm leading to marriages.