Methods to Analyse Signed Networks
Overview
Methods for the analysis of signed networks. This includes several measures for structural balance as introduced by Cartwright and Harary (1956) doi:10.1037/h0046049, blockmodeling algorithms from Doreian (2008) doi:10.1016/j.socnet.2008.03.005, various centrality indices, and projections of signed two-mode networks introduced by Schoch (2020) doi:10.1080/0022250X.2019.1711376.
This release fixes a number of bugs, rewrites the blockmodeling algorithms and speeds up several functions considerably. Results of signed_blockmodel() and signed_blockmodel_general() differ from earlier versions (see below).
Bug fixes
as_adj_complex()now respects theattrargument and works with named vertices. This also fixeslaplacian_matrix_complex(),as_incidence_complex()andcomplex_walks()for attributes other than"type".laplacian_matrix_signed(sparse = TRUE)no longer errors. Normalized Laplacians (signed and complex) no longer returnNaNfor isolated vertices.sample_islands_signed()always returnsislands.n * islands.sizevertices (previously failed when the highest-numbered vertices had no edges).balance_score(method = "walk")no longer overflows toNaNon dense networks.balance_score(method = "triangles")returnsNAfor networks without triangles.triad_census_signed()returns the census in canonical order.eigen_centrality_signed()returns a real vector for directed networks (or errors if the dominant eigenvalue is complex).ggblock()colors ties correctly if only one sign is present.ggsigned(type = "complex")now usesattrfor edge colors and no longer overwrites thetypeattribute.as_signed_proj()handles vertex names containing"-","pos"or"neg".complex_walks()validatesk.signed_blockmodel_general()returned a membership that did not match the reported criterion, and a wrong (even negative) criterion foralpha != 0.5. The meaning ofalphanow matchessigned_blockmodel().
Show all changes in 1.1.0Hide the rest of the changes in 1.1.0
signed_blockmodel(annealing = FALSE)no longer returns the random initial partition for networks with large blocks, and it always takes the best improving move.signed_blockmodel()andsigned_blockmodel_general()validatek,alphaandblockmat(square, symmetric for undirected networks).
Maintenance
- Signed adjacency and incidence matrices are built internally instead of using the deprecated
attrargument of igraph. Values of multiple edges are still summed. - Shared input validation. Errors no longer include the internal call.
- Triad census lookup tables moved from the R source to internal data (
data-raw/triad_tables.R). - Removed unused C++ code and added
src/Makevars. sample_gnp_signed()andsample_bipartite_signed()validatep_neg.- Added examples for
ggblock(),ggsigned()andfrustration_exact(). - Requires R >= 3.5.
Performance
count_signed_triangles(),signed_triangles()andcount_complex_triangles()are vectorized (several hundred times faster on networks with many triangles).as_incidence_complex()anddegree_signed()are vectorized and use sparse matrices.complex_walks()is about twice as fast.graph_circular_signed()computes arc lengths directly from the sampled angles, which also avoidsNaNs from rounding errors.- Both blockmodeling functions share a new C++ implementation (greedy local search and simulated annealing) that no longer copies the adjacency matrix for every move.
signed_blockmodel(annealing = TRUE)no longer usesstats::optim()and is about 25x faster.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-15
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-08
- ERROR12 OK, 1 ERROR2026-06-07
- OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
- NOTE13 OK, 1 NOTE2026-04-22
- ERROR12 OK, 1 NOTE, 1 ERROR2026-04-18
- NOTE13 OK, 1 NOTE2026-03-10
Documentation
- Help pages
- 33
- Examples that run
- 100%24 run in a plain check (3 of them under a condition)
- Exported functions with examples
- 80%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 27%
- 01 Signed Networks HTML
- 02 Structural Balance HTML
- 03 Blockmodeling HTML
- 04 Centrality HTML
- 05 Signed Two-Mode Networks HTML
- 06 Complex Matrices HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 0
PRs over time
Commits over time
15 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/schochastics/signnet on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-01 · The repository has a site deploy workflow
pkgdown site last built 2026-10-01
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-09-30Pull request it wrote: opened by a project memberCommits: at least 7 crediting it in the message
- Claude Opus 5.57 commits · Sep to Oct 2026
Dependencies
Installing signnet adds 11 packages (8 with compiled code, 11 MB of source tarballs). Heaviest: igraph 4.8 MB, Rcpp 1.8 MB, RcppArmadillo 1.0 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.1.0Latest
- RR 4.6.0 released · 2026-04-24
- 1.0.62025-11-06 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.0.52025-02-05 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.0.42024-01-08 · diff ↗
- 1.0.32023-12-15 · diff ↗
- 1.0.22023-09-08 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.0.12023-01-27 · diff ↗
- 1.0.02022-12-22 · diff ↗ ·
removed 1 export
laplacian_angleadded 5 exports
graph_from_adjacency_matrix_signed, graph_from_edgelist_signed, is_signed, sample_bipartite_signed, sample_gnp_signed - 0.8.12022-10-18 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.8.0
- RR 4.1.0 released · 2021-05-18
Show 9 earlier eventsHide 9 earlier events
Package metadata
- First published
- 2020-01-24
- Total releases
- 17 / 6 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5
- Bundled data
- 168 KB / 3 files
- Download size
- 1.0 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("signnet")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.21105/joss.04987.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.