Dab tsi yog qhov adjacency matrix thiab adjacency list?

Cov txheej txheem:

Dab tsi yog qhov adjacency matrix thiab adjacency list?
Dab tsi yog qhov adjacency matrix thiab adjacency list?
Anonim

Nyob rau hauv graph theory thiab computer science, ib tug adjacency matrix yog ib tug square matrix siv los sawv cev ib tug finite graph. Cov ntsiab lus ntawm matrix qhia seb khub ntawm vertices nyob ib sab lossis tsis nyob hauv daim duab. Hauv cov xwm txheej tshwj xeeb ntawm daim duab yooj yim kawg, qhov nyob ib sab matrix yog a-matrix nrog xoom ntawm nws kab pheeb ces kaum.

daim ntawv teev npe adjacency thiab adjacency txhais li cas?

Adjacency List: Ib daim ntawv teev npe nyob ib sab yog ib array suav nrog qhov chaw nyob ntawm txhua daim ntawv txuas. … Adjacency Matrix: Adjacency Matrix yog 2D array ntawm qhov loj V x V qhov twg V yog tus naj npawb ntawm vertices hauv ib daim duab. Cia lub 2D array yog adj, ib qhov adj[j]=1 qhia tias muaj ntug ntawm vertex i mus rau vertex j.

daim ntawv teev npe nyob ze txhais li cas?

Nyob rau hauv graph theory and computer science, a adjacency list is a sau cov npe uas tsis tau txiav txim siv los sawv cev ib daim duab finite. Txhua daim ntawv teev npe tsis muaj nyob hauv ib daim ntawv teev npe nyob ib sab piav qhia cov neeg nyob ze ntawm ib qho vertex hauv daim duab.

Dab tsi yog qhov adjacency matrix thiab daim ntawv piav qhia nrog piv txwv?

Cov matrix adjacency, qee zaum kuj hu ua kev sib txuas matrix, ntawm daim ntawv sau yooj yooj yim yog a matrix nrog cov kab thiab kab sau los ntawm daim duab vertices, nrog 1 lossis 0 hauv txoj haujlwm raws li seb thiab. nyob ib sab los tsis yog. Rau ib daim duab yooj yim uas tsis muaj tus kheej-loops, qhov adjacency matrix yuav tsum muaj 0s ntawm kab pheeb ces kaum.

yog dab tsiqhov txawv nruab nrab ntawm adjacency matrix thiab adjacency list?

Ib qho chaw nyob ib sab matrix occupies

2/8 byte chaw (ib me ntsis rau qhov nkag). Ib daim ntawv teev npe nyob ib sab occupies 8e qhov chaw, qhov twg e yog tus naj npawb ntawm cov npoo (32 ntsis computer). Yog li nrog cov lej no (tseem 32-ntsis tshwj xeeb) cov ntsiab lus tawg ntawm 1/64.

Pom zoo: