Skip to content

Commit

Permalink
Disambiguate and sort the 'relation' edge-attribute, if specified
Browse files Browse the repository at this point in the history
PR #250 introduces the 'simplify.multiple.relations' configuration option,
which can alter the edge-simplification algorithm for multi-networks.
Correspondingly, the edge-attribute handling does need adjustment to
work with this configuration option.

Disambiguate and sort the 'relation' edge-attribute when simplifying
multi-networks with the 'simplify.multiple.relations' option set.

This works towards #251.

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
  • Loading branch information
MaLoefUDS committed Mar 7, 2024
1 parent 56ff0b3 commit a34b5bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,9 @@ simplify.network = function(network, remove.multiple = TRUE, remove.loops = TRUE
## merge the simplified networks
network = merge.networks(networks)
} else {
network = igraph::simplify(network, edge.attr.comb = EDGE.ATTR.HANDLING,
relation.handling = function(relation) sort(unique(relation))
edge.attr.handling = modifyList(EDGE.ATTR.HANDLING, list(relation = relation.handling))
network = igraph::simplify(network, edge.attr.comb = edge.attr.handling,
remove.multiple = remove.multiple, remove.loops = remove.loops)
}

Expand Down

0 comments on commit a34b5bd

Please sign in to comment.