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
-
last certified : 24 Aug 2026
nwcommands version 3.17.6, 9 November 2026 (check your installed version)