nwissymmetric

Check whether a network is symmetric

Syntax

nwissymmetric 
[netname]

Description

nwissymmetric simply checks if the underlying adjacency matrix of network netname is symmetric, regardless of whether the network is assigned to be directed or undirected (see nwname). An adjacency matrix M is symmetric when M_ij == M_ji. Returns r(issymmetric) in the return vector.

This command can be useful for programming, when one wants to detect if a network should be undirected.

For example, nwimport automatically checks if a network (e.g. Ucinet fullmatrix) is symmetric and if yes, imports the network as undirected.

Examples

. nwwebuse florentine
. nwissymmetric flomarriage
. return list

scalars:
        r(issymmetric) = 1

Note: r(issymmetric) is a plain numeric 0/1 scalar - unlike the true/false string macros most other boolean-flag results in this group use (e.g. nwname’s r(directed)), since it is a computed test result rather than a stored network property.

Supported network types

Binary: yes. Directed: yes - this command’s entire purpose is checking whether a directed network’s matrix happens to be symmetric. Weighted: yes, checks exact value symmetry, not just tie presence. Signed: yes, a negative value is compared like any other. 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.