计算机高手请帮忙,谢谢!

来源:百度知道 编辑:UC知道 时间:2024/06/21 09:49:32
A directed graph, or digraph G consists of a finite nonempty set of vertices V, and a finite set of edges E, where an edge is an ordered pair of vertices in V. Vertices are also commonly referred to as nodes. Edges are sometimes referred to as arcs.

BFS starts at a given vertex, which is at level 0. In the first stage, we visit all vertices at level 1. In the second stage, we visit all vertices at second level. These new vertices, which are adjacent to level 1 vertices, and so on. The BFS traversal terminates when every vertex has been visited.
BREADTH FIRST SEARCH (G, S)
Input: A graph G and a vertex.
Output: Edges labeled as discovery and cross edges in the connected component.
Create a Queue Q.
ENQUEUE (Q, S) // Insert S into Q.
While Q is not empty do
for each vertex v in Q do
for all edges e incident on v do
if edge e is unexplored then
let w be the other endpoint of e.

-----------帮你翻译一下-----------------
翻译: 英语 » 中文

有向图,或图克组成的有限非空子集的顶点V和有限的一套边英,那里的优势是下令对顶点在五顶点也称为节点。边缘,有时被称为自动垃圾收集系统。

高炉开始在某一特定的顶点,这是在级别0 。在第一阶段,我们访问的所有顶点在第1级。在第二阶段,我们访问的所有顶点在第二个层次。这些新的顶点,这是毗邻的第1级的顶点,等等。该高炉遍历终止时,每个顶点已访问。
广度优先搜索(克, s )的
输入:一个图G和一个顶点。
输出:边缘标记为发现和交叉的优势,在所连接的组成部分。
创建一个队列问:
enqueue (的Q ) / /插入s到问:
而Q是不是空的做
为每个顶点v在Q做
所有的优势, e事件在V做
如果边缘E是未知,然后
让瓦特被其他端点权证
如果顶点瓦特是意想不到的,然后
-马克e视发现边缘
-插入瓦特到q
其他的
马克e视交叉边缘

I don't know .

你的提问好乱阿!!

不明白啦!

什么东西```

-_-!不懂