CorePeripheryNetwork: A core-periphery network generator

class epydemic.CorePeripheryNetwork(params=None, limit=None)

A generator of core-periphery networks as described by Hebert-Dufresne and Allard [HebertDA19]. These consist of two ER networks of different sizes and internal edge densities, connected by edges with the density of the periphery (which is typically substantially less than that of the core).

The resulting network is restricted to its largest connected component.

Parameters:
  • params (Optional[Dict[str, Any]]) – experimental parameters

  • limit (Optional[int]) – (optional) limit on number of networks that can be generated

Experimental parameters

CorePeripheryNetwork.N_core: Final[str] = 'coreperiphery.N-core'

Experimental parameter holding the size of the core network.

CorePeripheryNetwork.PHI_core: Final[str] = 'coreperiphery.phi-core'

Experimental parameter holding the edge probability of the core network.

CorePeripheryNetwork.N_per: Final[str] = 'coreperiphery.N-periphery'

Experimental parameter holding the size of the peripheral network.

CorePeripheryNetwork.PHI_per: Final[str] = 'coreperiphery.phi-periphery'

Experimental parameter holding the edge probability of the peripheral network.

The generated network also has a node attribute defined:

CorePeripheryNetwork.ORIGIN: Final[str] = 'origin'

State variable holding a node’s origin in the core (0) or periphery (1).

Generator methods

CorePeripheryNetwork.topology()

Return the topology marker string.

Return type:

str

Returns:

the topology marker

CorePeripheryNetwork._generate(params)

Generate a core-periphery network.

Parameters:

params (Dict[str, Any]) – the experimental parameters

Return type:

Graph

Returns:

the network

Accessing the core and periphery

For networks generated by this generator, we can extract the sub-networks comprising the core and periphery. Only the edges within the sub-network will be included.

static CorePeripheryNetwork.coreSubNetwork(g)

Return the sub-network composing the core. This method will only work for networks created by this class, that have the ORIGIN property set correctly. An exception will be raised if the core can’t be identified.

Parameters:

g (Graph) – the network

Return type:

Graph

Returns:

the core sub-network

static CorePeripheryNetwork.peripherySubNetwork(g)

Return the sub-network composing the periphery. This method will only work for networks created by this class, that have the ORIGIN property set correctly. An exception will be raised if the core can’t be identified.

Parameters:

g (Graph) – the network

Return type:

Graph

Returns:

the core sub-network