Puas yog tsob ntoo qhia lossis tsis ncaj?

Cov txheej txheem:

Puas yog tsob ntoo qhia lossis tsis ncaj?
Puas yog tsob ntoo qhia lossis tsis ncaj?

Video: Puas yog tsob ntoo qhia lossis tsis ncaj?

Video: Puas yog tsob ntoo qhia lossis tsis ncaj?
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim

Nyob rau hauv daim duab txoj kev xav, ib tsob ntoo yog ib daim duab tsis ncaj ncees nyob rau hauv uas ob lub vertices txuas nrog raws nraim ib txoj kev, los yog sib npaug ib qho kev sib txuas acyclic undirected graph. … Ib tug polyforest (los yog cov hav zoov taw qhia los yog oriented hav zoov) yog ib tug qhia acyclic graph uas nws lub hauv paus undirected graph yog ib tug hav zoov.

Yuav coj li cas thiab tsis coj ntoo?

Ib daim duab uas tsis muaj kev taw qhia uas tsis muaj voj voog yog a hav zoov thiab yog nws txuas nws hu ua tsob ntoo. Daim duab qhia yog hav zoov (los yog tsob ntoo) yog tias thaum tag nrho cov npoo hloov mus rau qhov tsis ncaj ncees nws yog qhov tsis ncaj ncees lawm hav zoov (lossis tsob ntoo). Ib tsob ntoo hauv paus yog tsob ntoo uas muaj ib qho vertex uas yog lub hauv paus.

Vim li cas ntoo thiaj tsis ncaj?

Theorem: Daim duab tsis qhia yogtsob ntoo iff muaj ib txoj hauv kev yooj yim ntawm txhua khub ntawm vertices Pov thawj: Yog tias peb muaj daim duab T uas yog tsob ntoo, ces nws yuav tsum tau txuas nrog tsis muaj voj voog. Txij li thaum T txuas nrog, yuav tsum muaj tsawg kawg ib txoj hauv kev yooj yim ntawm txhua khub ntawm vertices.

txhais tau tias yog tsob ntoo directed?

Ib tsob ntoo taw qhia yog an acyclic directed graph Nws muaj ib qho nrog indegree 1, thaum tag nrho lwm cov nodes muaj indegree 1 raws li qhia hauv daim duab: Cov node uas muaj outdegree 0 yog hu ua sab nraud node lossis lub davhlau ya nyob twg los yog nplooj. Cov nodes uas muaj outdegree ntau dua los yog sib npaug rau ib tug yog hu ua internal node.

Koj qhia li cas yog daim duab tsis ncaj ncees yog tsob ntoo?

Nyob rau hauv cov ntaub ntawv ntawm undirected graphs, peb ua peb kauj ruam:

  1. Ua ib daim DFS kuaj los ntawm ib lub node kom paub tseeb tias txhua lub node muaj ib tug niam txiv raws nraim. Yog tsis yog, xa rov qab.
  2. Kuaj xyuas tias tag nrho cov nodes tau mus xyuas. Yog tias daim tshev DFS tsis tuaj yeem mus saib tau tag nrho cov nodes, ces rov qab.
  3. Lwm yam, daim duab yog tsob ntoo.

Pom zoo: