# contract: Group the Chosen Players in a Network In keyplayer: Locating Key Players in Social Networks

## Description

contract combines selected nodes into one large pseudo-node and provides a reduced network.

## Arguments

 adj.matrix Matrix indicating the adjacency matrix of the network. The inputted adjacency matrix for the diffusion centrality should be properly transfomred to the probability interpretation. nodes Integer indicating the column index of the chosen player in the adjacenncy matrix. method Indication of which grouping criterion should be used. method="min" indicates the "minimum" criterion (edge values as distances). method="max" indicates the "maximum" criterion (edge values as non-cummulative strengths). method="add" indicates the "addition" criterion (edge values as cummulative strengths). method="union" indicates the "union" criterion (edge values as probability). The default is "min". See details for examples.

## Details

Minimum Criterion: the edge value between a group and an outside node is measured as the minimal value among all the (nonzero) edge values between any node in the group and the outside node. Suggested if edge values are interpreted as distances.
Example: suppose node A to C has distance 2 and B to C has distance 1, then according to the minimum criterion, the distance between C and the merged set AB is 1. Note that if B and C are not connected, the algorithm takes the distance between A and C to describe the distance between AB and C.

Maximun Criterion: the edge value between a group and an outside node is measured as the maximal value among all the (nonzero) edge values between any node in the group and the outside node. Suggested if edge values are interpreted as non-cummulative strengths.
Example: we keep using the above example, but the figure now indicates the strength of tie. According to the maximum criterion, the strength of tie between AB and C is 2.

Addition Criterion: the edge value between a group and an outside node is measured as the sum of all the edge values between any node in the group and the outside node. Suggested if edge values are as cummulative strengths.
Example: according to the addition criterion, the strength of tie between AB and C is 3

Union Criterion: the edge value between a group and an outside node is measured as the probability that there is at least one path connecting the group with the outside node. Suggested if edge values are as probability.
Example: suppose A has probability 0.2 to reach C and B has probability 0.5 to reach C, then C can be reached from merged AB with probability 1-(1-0.2)*(1-0.5)=0.6 according to the union criterion.

## Value

A new adjacency matrix after contracting the chosen nodes (named set).

## Author(s)

Weihua An [email protected]; Yu-Hsin Liu [email protected]

## References

An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks." Working Paper, Indiana Univeristy.