Skip to content

Commit

Permalink
#21 Use sum of lns as weight function
Browse files Browse the repository at this point in the history
  • Loading branch information
hleb-albau committed Nov 22, 2018
1 parent 61182a7 commit 70dcb20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion research/ethereum/common/adjacency_list_to_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import humanize
import networkx as nx
import math

import numpy as np
from networkx import DiGraph

from common.tools import human_readable_interval
Expand Down Expand Up @@ -34,7 +36,7 @@ def load_edges(data_file: str) -> Edges:
if cells[2] == "0":
continue
edge = (cells[0], cells[1])
weight = math.sqrt(float(cells[2]))
weight = np.log(float(cells[2]))

if edge not in edges:
edges[edge] = weight
Expand Down

0 comments on commit 70dcb20

Please sign in to comment.