Skip to content

Faster normalizeSimilarity() and networkPlot(), OpenAlex ids in cocMatrix(), normalized Co-citation in Biblioshiny - #701

Merged
massimoaria merged 5 commits into
masterfrom
develop
Sep 29, 2026
Merged

massimoaria merged 5 commits into
masterfrom
develop

Conversation

@massimoaria

Copy link
Copy Markdown
Owner

Changes

  • cocMatrix() keeps short OpenAlex work ids in CR (d089214). The filter that drops CR entries of 10 characters or fewer was discarding the ids of older OpenAlex works (W + 6-9 digits). On a 585-document OpenAlex API collection, 911 of the 53,078 references (1.7%) were lost. For WoS and Scopus collections, the matrices compare identical() before and after.
  • normalizeSimilarity() works on the non-zero cells only (01c98ad). outer() built dense n x n matrices. On a 9,999-node co-citation network, time drops from 2.9 s to 0.03 s and the memory peak from 4.85 GB to about 335 MB. For all five indices, values and class compare identical(). An unknown type, or a non-square matrix, is now refused with a message that names it.
  • Biblioshiny: Normalization Method option for the Co-citation network (03d03d3). It matches the Co-occurrence and Collaboration networks, with Association as the default. The normalized similarity drives the layout.
  • networkPlot() is 4-16 times faster on dense networks (454344b). Edge colouring and the community.repulsion weights are now computed on the whole edge list, not edge by edge. On a 120,836-edge co-citation network, 23 s become 6 s. In 20 configurations, the graph, layout, cluster table, modularity and Pajek graph compare identical().

Tests

The full suite passes locally (610 passed, 0 failed). New tests cover the OpenAlex ids, normalizeSimilarity() against the dense formula, edge colours, and repulsion weights. Each change has an entry in NEWS and NEWS.md.

The filter that drops CR entries of 10 characters or fewer discarded the
ids of older OpenAlex works (W + 6-9 digits): 911 of 53,078 references
(1.7%) on a 585-document OpenAlex API collection. Such ids are now kept.
Matrices for WoS and Scopus collections compare identical() before and
after.
…only

outer() on the diagonal built dense n x n matrices (4.85 GB peak on a
9,999-node co-citation network) and inclusion called min() per cell via
mapply(). The indices are now computed on the sparse triplets: 0.03 s
instead of 2.9 s on the same network. Values and class compare
identical() with the old implementation for all five indices; an unknown
type or a non-square matrix is refused by name.
…twork

The option was left out because normalizeSimilarity() built dense
matrices. Default Association, as in the Co-occurrence and Collaboration
networks; the normalized similarity drives the layout.
…the whole edge list

An apply() over the edges re-read the vertex attribute for every edge,
and the community.repulsion weights looked up both end points with
which() in a loop: about three quarters of the time on a 120,836-edge
co-citation network. Now vectorised: 23 s become 6 s there, 14 s become
1-2 s on coupling and author co-citation. Graph, layout, cluster table,
modularity and Pajek graph compare identical() in 20 configurations.
@massimoaria
massimoaria merged commit e757526 into master Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant