nwshared

Number of shared neighbors of all pairs of nodes, as a network

Syntax

nwshared 
[netname]
[,
name(newnetname)
undirected
replace]
   
name(newnetname) Save as new network; default _shared
undirected Treat all ties as undirected for calculation
replace if a network named newnetname already exists, drop it and use this name anyway (alias: nwreplace, kept for backward compatibility - most sibling generators in this package instead spell this replace)

Description

This command calculates for each connected pair of nodes (i,j) the number of nodes k that both i and j have as shared neighbors.

Supported network types

Binary: yes (only) - shared-tie/exposure counting is a structural property, tie values are ignored (via nwsym’s own binarizing generate() path). Directed: requires undirected to symmetrize first; on a directed network without it the command stops with error 198. Weighted: not applicable. Signed: not applicable. Two-mode: same as for the bipartite graph read as a one-mode network (valid; no mode-specific normalisation).

See also


nwcommands version 3.17.6, 9 November 2026 (check your installed version)


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.