pm4py.read.read_dfg#

pm4py.read.read_dfg(file_path: str) Tuple[Dict[Tuple[str, str], int], Dict[str, int], Dict[str, int]][source]#

Reads a DFG object from a .dfg file. The DFG object returned is a triple containing the following objects:

  1. DFG Object, encoded as a Dict[Tuple[str,str],int], s.t. DFG[('a','b')]=k implies that activity 'a' is directly followed by activity 'b' a total of k times in the log

  2. Start activity dictionary, encoded as a Dict[str,int], s.t., S['a']=k implies that activity 'a' is starting k traces in the event log

  3. End activity dictionary, encoded as a Dict[str,int], s.t., E['z']=k implies that activity 'z' is ending k traces in the event log.

Return type:

Tuple[Dict[Tuple[str,str],int], Dict[str,int], Dict[str,int]]

Parameters:

file_path (str) – file path of the dfg model on disk

import pm4py

dfg = pm4py.read_dfg("<path_to_dfg_file>")