![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
づ┕KaiГε
这个作者很懒,什么都没留下…
展开
-
python算法有向图的最大流和最小割及割边输出
import copy from collections import deque def hasPath(Gf, s, t, path): # BFS algorithm V = len(Gf) visited = list(range(V)) for i in range(V): visited[i] = False visited[s] = True queue = deque([s]) w...原创 2019-09-10 14:22:53 · 2101 阅读 · 0 评论 -
python算法将有向图邻接矩阵形式变成邻接链表形式
GF = [ [0,4,6,0,0], [0,0,2,3,0], [0,0,0,0,4], [0,0,0,0,5], [0,0,0,0,0] ] g={} for i in range(len(GF)): a=[] for j in range(len(GF)): if GF[i][j]!=0: a.appe...原创 2019-09-10 15:49:05 · 1877 阅读 · 0 评论 -
python使用matplotlib画图
matplotlib安装 先下载matplotlib包下载网址https://www.lfd.uci.edu/~gohlke/pythonlibs/ pip install numpy+mkl Pip install scipy … 为了画频谱图,安装第三方库先后顺序如下(后者因为依赖前者,所以必须按顺序): 1.numpy+mkl 2.scipy 3.six 4.python_dateutil...原创 2019-09-10 15:58:08 · 187 阅读 · 0 评论