This presentation is the property of its rightful owner.
Sponsored Links
1 / 52

第 6 章 圖形與網路 PowerPoint PPT Presentation


  • 149 Views
  • Uploaded on
  • Presentation posted in: General

第 6 章 圖形與網路. 圖形簡介 拓樸排序 圖形表示法 網路的進階應用 圖形追蹤 花費最小擴張樹 圖形最短路徑. 無向圖形 (1). 6-1 圖形簡介. 是一種具備同邊的兩個頂點沒有次序關係,例如 (V 1 ,V 2 ) 與 (V 2 ,V 1 ) 是代表相同的邊。請看下圖 G :. V(G)={V 1 ,V 2 ,V 3 ,V 4 } E(G)={(V 1 ,V 2 ),(V 1 ,V 3 ), (V 1 ,V 4 ), (V 2 ,V 3 ),(V 2 ,V 4 ),(V 3 ,V 4 )}. 無向圖形 (2).

Download Presentation

第 6 章 圖形與網路

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


6

6


6

(1)

6-1

  • (V1,V2)(V2,V1)G

V(G)={V1,V2,V3,V4}

E(G)={(V1,V2),(V1,V3), (V1,V4), (V2,V3),(V2,V4),(V3,V4)}


6

(2)

6-1

    • (Simple Path)

    • (Cycle)

    • (Path)ViVj

    • (Path Length)

    • (Complete Graph)nn*(n-1)/2


6

6-1

  • (Connected Component)(Subgraph)

  • (Subgraph)GGV(G) V(G)E(G) E(G)

  • (Adjacent)(Vi,Vj)E(G)ViVj

  • (Incident)ViVj(Vi,Vj)ViVj


6

(1)

6-1

  • <V1,V2><V1,V2><V2,V1>

V(G)={V1,V2,V3}

E(G3)={<V1,V2>,<V2,V1>,<V3,V2>}


6

(2)

6-1

    • (Complete Graph)nn*(n-1)

    • (Path)VpVqVp,Vi1,Vi2Vin,Vq<Vp,Vi1>,<Vi1,Vi2><Vin,Vq>

    • (Strongly Connected)Vi,VjVjVi

    • (Strongly Connected Component)

    • (In-degree)V

    • (Out-degree)V


6

6-2


6

(Edge)

6-2


6

(1)

6-2

  • nn


6

6-2


6

(1)

6-2

  • MV1V2

    • LINK1V1LINK1V1NULL

    • LINK2V2LINK2V2NULL


6

(2)

6-2

  • m(boolean)

  • 6.1.1


6

6-2

  • nn


6

(1)

6-3

  • VxVyVy

  • Vx


6

(2)

6-3

  • ch06_01.cpp


6

6-3


6

6-3


6

6-3


6

(1)

6-3

    • V1V2V3

    • V2V4V5(V1)


6

6-3

  • V3V6V7(V1)

  • V4V8(V2)

  • V1V2V3V4V5V6V7V8


6

6-3

  • DFSBFSG=(V,E)TB(TB)if S=(V,T)G(Spanning Tree)

(Cycle)

1.E=T+B

2.BS(Cycle)

3.V2ViVjS


6

(1)

6-3


6

(2)

6-3


6

Prim

6-4

  • Prim

G=(V,E)nV={1,2,3n}U={1}UVVUXUXUU=V


Kruskal s 1

Kruskals(1)

6-4

  • Kruskals

  • 6.4.1

    • G=(V,E),e'Ee'GMSTe'

G=(V,E)V={1,2,3,n}n

ET=(V,)T

ETETTn-1


Kruskal s 2

Kruskals(2)

6-4

  • ch06_02.cpp


6

6-4


6

6-4


6

6-4


6

6-4


6

(1)

6-5

  • DijkstraDijkstra

    • S={Vi | ViV}ViV0Sw SDIST(w)V0wwS

      • uuVS


6

6-5

  • uuSV0uwSDIST(w)

  • Dijkstra

DIST(w)Min{DIST(w),DIST(u)+COST(u,w)}

1D[L]=A[F,I][I=1,N]

S={F}

V=[1,2,3N]

DNFA[F,I]FIVS

2VStD(t)tSVS

3D

D[I]=min(D[I],D[t]+A[t,I])[(I,t)E]


6

(2)

6-5

  • ch06_03.cpp


6

6-5


6

6-5


6

6-5


6

6-5


6

6-5

    • nAn(i,j)ijGCOST(i,i)=0ij<i,j>GCOST(i,j)=

    • A0 (i,j)cost(i,j)ViVjAk(i,j)ijk

    • A0A1A2Anij

Ak(i,j)=min{Ak-1(i,j),Ak-1(i,k)+Ak-1(k,j)} k1


6

6-5

  • 6.5.1

    • Floyd(A0A1A2A3)


6

(1)

6-5

  • G(i,j)ij

  • G

    • (Transitive Closure Matrix)A+ij0A+ [i][j]=10

    • (Reflexive Closure Matrix)A*ij0A* [i][j]=10


6

(2)

6-5

  • G=(V,E)n(Path Matrix)A

  • An(ij)ijn

  • ikkj=ijA2

A1+A2+A3+An

n

k=1


6

(3)

6-5

  • 6.5.2

    • A+


6

(1)

6-6

  • AOVViVjViVj

  • (Topological Sort)()

1.AOV

2.


6

(2)

6-6

    • 1.V1V1<V1,V2><V1,V3><V1,V4>


6

6-6

  • 2.V2V3V4V4

  • 3.V3

  • 4.V6

  • 5.V2V5

=>V1V4V3V6V2V5


6

AOE

6-7

  • 14action(12314)12event(V 1V 2 V12)

  • V 1V12V 1V12


6

6-7


6

6-7

  • PERT


6

6-7

    • 1

    • 2

    • 3

    • 4=

++4*()

6

1

2

3


6

6-7

    • TE

    • TL


6

6-7

    • TE=TL


6

6-7


  • Login