use rye
rye syncpython src/data/generate_overlap_graphs.py
for n in `seq -f '%04.0f' 100 100 2000`
do
python scripts/draw.py --dest data/drawing/sgd/random_tree/$n data/graph/random_tree/$n/*
done
for n in `seq -f '%04.0f' 100 100 2000`
do
python scripts/draw_webcola.py --dest data/drawing/webcola/random_tree/$n data/graph/random_tree/$n/*
done
for n in `seq -f '%04.0f' 100 100 2000`
do
python scripts/draw.py --dest data/drawing/sgd/overlap/$n --overlap-removal data/graph/overlap/$n/*
done
for n in `seq -f '%04.0f' 100 100 2000`
do
python scripts/draw_webcola.py --dest data/drawing/webcola/overlap/$n --overlap-removal data/graph/overlap/$n/*
done
parallel --bar 'python scripts/draw.py --dest=data/drawing/sgd/cluster/{1} --overlap-removal --cluster-overlap-removal data/graph/cluster/{1}/node_n={1}_{2}.json' ::: $(seq -f '%04.0f' 100 100 2000) ::: $(seq -f '%02.0f' 0 19)
parallel --bar 'python scripts/draw_webcola.py --dest=data/drawing/webcola/cluster/{1} --overlap-removal --cluster-overlap-removal data/graph/cluster/{1}/node_n={1}_{2}.json' ::: $(seq -f '%04.0f' 100 100 2000) ::: $(seq -f '%02.0f' 0 19)
parallel --bar 'mkdir -p result/plot/{1}/{2}/{3}' ::: sgd webcola ::: random_tree overlap cluster ::: $(seq -f '%04.0f' 100 100 2000)
parallel --bar 'node js/src/render.js --graphFile=data/graph/{2}/{3}/node_n\={3}_{4}.json --drawingFile=data/drawing/{1}/{2}/{3}/node_n\={3}_{4}.json --output=result/plot/{1}/{2}/{3}/node_n={3}_{4}.png' ::: sgd webcola ::: random_tree overlap cluster ::: $(seq -f '%04.0f' 100 100 2000) ::: $(seq -f '%02.0f' 0 19)
for type in cluster
do
python scripts/calc_stress.py data/graph/$type.csv result/stress/$type-0100-2000.csv
python scripts/create_boxplot.py result/stress/$type-0100-2000.csv result/stress/$type-0100-2000.png
done
for type in random_tree
do
python scripts/calc_violation.py data/graph/$type.csv result/stress/$type-0100-2000.csv
python scripts/create_boxplot.py result/stress/$type-0100-2000.csv result/stress/$type-0100-2000.png
done
- 1138busの制約を作成
- 中心から階層を計算、その後辺のノードペアに対して、層の差を距離とした
python src/data/generate_constraint_by_type.py-
stressとviolationの計測
<save directory>内に中間ファイルとしてcompare_seed{i}.jsonを生成。
-
形式
{
"seed": i,
"iteration": args.iterations,
"unicon": {"stress": su, "violation": vu, "drawing": posu},
"constrained_sgd": {"stress": scs, "violation": vcs, "drawing": poscs},
},- 実行方法
python scripts/drawing_and_stress_violation.py <graph file> <save directory> [option]- 箱ひげ図の生成
python scripts/compare_stress_violation.py <compared directory> [option]- road_central
- 1138 bus
- グラフから一部を取り出す。距離行列も計算している
python scripts/convert_large_mtx_to_ego.py <mtx graph file path> <networkx graph file output path> <hub number(中心の数)> <radius(中心からの半径)>- 必要であれば同心円状の制約を付加する。引数のファイルに追加される
python scripts/add_circle_constraint.py <networkx graph file path>python scripts/draw.py --space torus [option] <graph file path>
python scripts/plot_torus.py <graph file> <drawing file> <output file>python scripts/draw.py --space hyperbolic [option] <graph file path>
python scripts/plot.py <graph file> <drawing file> <output file>- 制約の形式
{
"type": "circle",
"nodes": list,
"r": int,
"center": int | None,
}- 射影のコード
src/sgd/projection/circle_constraints.py
circle_constraints = [
[
[indices[v] for v in c["nodes"]],
c["r"],
indices[c["center"]] if c.get("center") is not None else None,
]
for c in nx_graph.graph["constraints"]
if c.get("type", "") == "circle"
]