https://github.com/kit-parco/networkit
Tip revision: 4a772bc4b608efde2412d4498f931c0aabc35c43 authored by Fabian Brandt on 01 July 2021, 15:55:31 UTC
Merge pull request #783 from fabratu/fix-compiler-search
Merge pull request #783 from fabratu/fix-compiler-search
Tip revision: 4a772bc
dynamic.py
# extension imports
from .graph import Graph
from .dynamics import GraphEvent, DGSStreamParser, GraphUpdater, GraphDifference
from .distance import APSP
def graphFromStream(stream, weighted, directed):
""" Convenience function for creating a new graph from a stream of graph events
Parameters:
-----------
stream : list of GraphEvent
event stream
weighted : produce a weighted or unweighted graph
boolean
directed : produce a directed or undirected graph
boolean
"""
G = Graph(0, weighted, directed)
gu = GraphUpdater(G)
gu.update(stream)
return G