-->
当前位置:首页 > 题库 > 正文内容

单选题:Use Dijkstra algorithm to find the shortest paths from v1 to eve

Luz4年前 (2022-01-18)题库909
When Dijkstra's algorithm is used to find the shortest paths from $$v_1$$ to every other vertices in an undirected graph G, a distance set $$dist[v]$$ is maintained for every vertex $$v$$, as the shortest distance from $$v_1$$ to $$v$$, passing through only the vertices whose shortest path to $$v_1$$ has been determined.

Suppose that the destinations are obtained in the order of { $$v_2$$, $$v_3$$, $$\cdots $$, $$v_n$$ }. If there is a vertex $$w$$ in G so that $$dist[w]$$ is decreased during every iteration (except the last one) of the algorithm, how many statements of the following are **correct**?

(1) $$w$$ is $$v_n$$.

(2) $$w$$ is adjacent to every other vertices.

(3) ($$v_1$$, $$w$$) (if it exists) is the longest edge among all the edges that are adjacent to $$w$$.




A.0
B.1
C.2
D.3


答案:D

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。