attempt_latticization: Attempt to swap the target vertices between a pair of edges

Description Usage Arguments Details Value

View source: R/latticize.R

Description

This will typically be used in a loop to incrementally mutate a graph to become more lattice-like.

Usage

1
attempt_latticization(x, d, allow_disconnect)

Arguments

x

An adjacency matrix or igraph object representing the graph to mutate.

d

A square matrix with as many rows and columns as vertices in x, which expresses distance to the diagonal. A cannonical d can be generated with the distance_to_diagonal function.

allow_disconnect

A logical indicating where a mutation is allowed to disrupt the connectedness of the network. If FALSE, then x must be connected to begin with and represented as an igraph object. The connectedness check is not implemented for plain adjacency matrices.

Details

If allow_disconnect == TRUE, the procedure does not require igraph. If FALSE, igraph is required.

A mutation will occur only under the following conditions: 1. The mutation will create new edges. 2. The mutation will create edges that correspond to smaller values in d. 3. If allow_disconnect == FALSE, the mutation must not disrupt network connectedness.

The test for connectedness is slow compared to the other tests and the rewiring operation itself.

Value

A mutated version of x.


crcox/latticize documentation built on Dec. 19, 2021, 6:19 p.m.