METIS is a software package with vrious algorithms for dividing graphs.
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz
tar zxfv metis-5.1.0.tar.gz
cd metis-5.1.0/build
cmake ../
make config shared=1
make && make install
export PATH=/usr/local/lib:$PATH
export LD_LIBRARY_PATH=/usr/local/lib/
python3 -m pip install metis
[node id1] [node id2] [weight]
ex) 1 2 5
represent node 1 has an edge at node 2, its weight is 5.
python graph_partition_by_metis.py [Input File] [node number] [partition number]