def __calculate_edge_weights(dfs_data):
graph = dfs_data['<STR_LIT>']<EOL>weights = {}<EOL>for edge_id in graph.get_all_edge_ids():<EOL><INDENT>edge_weight = __edge_weight(edge_id, dfs_data)<EOL>weights[edge_id] = edge_weight<EOL><DEDENT>return weights<EOL>
Calculates the weight of each edge, for embedding-order sorting.