scglue.graph.collapse_multigraph
- scglue.graph.collapse_multigraph(graph, merge_fns=None)[源代码]
Collapse multi-edges into simple-edges
- 参数:
graph (
MultiGraph
) – Input multi-graphmerge_fns (
typing.Optional
[typing.Mapping
[str
,typing.Callable
]]) – Attribute-specific merge functions, indexed by attribute name. Each merge function should accept a list of values and return a single value.
- 返回类型:
- 返回:
collapsed – Collapsed graph
备注
The collapsed graph would be directed if the input graph is directed. Edges causing ValueError in
merge_fns
will be discarded.