Skip to content

Commit

Permalink
Change minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusKiso authored and JuliusKiso committed Aug 16, 2023
1 parent 318501d commit 2415694
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ding0/grid/lv_grid/build_grid_on_osm_ways.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import networkx as nx
import pymetis

# G. Karypis, V. Kumar: A fast and high quality multilevel scheme for partitioning irregular graphs
# https://www.cs.utexas.edu/~pingali/CS395T/2009fa/papers/metis.pdf

import osmnx as ox
import numpy as np
from math import tan, acos
Expand All @@ -42,7 +39,11 @@


def partition_network(network, n_parts=2, node_weight='load', edge_weight='length', contiguous=True):
"""Partition a network graph into multiple parts using the Metis graph partitioning algorithm.
"""
Partition a network graph into multiple parts using the METIS graph partitioning software with
python wrapper PyMetis (k-way graph partitioning is applied, see
G. Karypis, V. Kumar: A fast and high quality multilevel scheme for partitioning irregular graphs
https://www.cs.utexas.edu/~pingali/CS395T/2009fa/papers/metis.pdf)
Parameters
----------
Expand Down Expand Up @@ -519,7 +520,7 @@ def build_branches_on_osm_ways(lvgd):
for edge in G.edges:
G.edges[edge]['length'] = int(np.ceil(G.edges[edge]['length']))

_, parts = pymetis_parts.partition_network(G, int(n_feeder), node_weight='load', edge_weight='length')
_, parts = partition_network(G, int(n_feeder), node_weight='load', edge_weight='length')

else:
parts = [list(nodelist)]
Expand Down

0 comments on commit 2415694

Please sign in to comment.