nsl.tools.read_tsv_graph

Reads the file filename containing graph edges in TSV format.

filename Name of a TSV file specifying the edges of a graph. Each line of the input file should be the specification of a single graph edge in the form source\<TAB\>target[\<TAB\>weight]. If supplied, weight should be a floating point number; if not supplied, it defaults to 1.0. Multiple edges between the same source and target node IDs are combined by picking the edge with the largest weight.

A graph represented as a dict: source -> (target -> weight).