Browse Source

New translations test_sp_methods.py (Chinese Simplified)

l10n_v0.2.x
linlin 4 years ago
parent
commit
a3e197f7f7
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      lang/zh/notebooks/tests/test_sp_methods.py

+ 22
- 0
lang/zh/notebooks/tests/test_sp_methods.py View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test networkx shortest paths methods.
Created on Tue Oct 9 14:49:09 2018

@author: ljia
"""

import networkx as nx

g = nx.Graph()
g.add_edge(1, 2)
g.add_edge(3, 2)
g.add_edge(1, 4)
g.add_edge(3, 4)
p1 = nx.shortest_path(g, 1, 3)
p1 = [p1]
p2 = list(nx.all_shortest_paths(g, 1, 3))
p1 += p2
pr = [sp[::-1] for sp in p1]
nx.draw(g)

Loading…
Cancel
Save