spa个人总结范文.docxVIP

  • 18
  • 0
  • 约1.72千字
  • 约 4页
  • 2019-08-16 发布于四川
  • 举报
2019年SPA个人总结范文    单源,带权有向图,不能有负权回路,也不能有负权边,复杂度为O(n^2),贪心思想(每次选出一个最小路径节点,并用此来relax别的尚未选出的节点),具体如下所述: ?    Dijkstra(G,w,s) ?    (1).initializearraydtobethedistancebetweensandotherverticle,declareboolarrayusedtoflagiftheverticleischosenout,andusedistobefalseatfirst,exceptused[s]=1. ?    (2).foreachverticleinthegraphchoosetheshortestverticlev(edge)inarrayd ?    used[v]=1; ?    withvtorelaxotherverticlewhichhasntbeenusedinthegraph//hereisaprocessofloop2.Bellman-Ford ?    单源,带权有向图,可以存在负权回路(算法能给找出来,如果有的话),复杂度为O(ne),其想法如下: ?    其实就是对每条边进行|V|-1次Relax操作,然后在此基础上检查是否是存在负权回路。 ?    forifrom

文档评论(0)

1亿VIP精品文档

相关文档