Given a graph below and colors numbered 1, 2, 3, ... are assigned to vertices with the sequential coloring algorithm that orders vertices by alphabetical order (i.e. the vertex labeled A comes first, then the vertex B,...) What is the color of the vertex G?

5 phương ánCó giải thích

Các phương án trả lời

Chọn một phương án
Lời giảiChọn phương án để mở
Đáp án đúng: "2". Đồ thị có các cạnh A–B, A–C, A–D, A–G, B–C, B–E, C–E, E–F, E–G và D–F. Tô tuần tự theo thứ tự chữ cái, mỗi đỉnh nhận màu nhỏ nhất chưa bị đỉnh kề đã tô dùng: A được 1; B kề A nên được 2; C kề A màu 1 và B màu 2 nên được 3; D kề A màu 1 nên được 2; E kề B màu 2 và C màu 3, không kề đỉnh nào màu 1 nên được 1; F kề E màu 1 và D màu 2 nên được 3; cuối cùng G kề A màu 1 và E màu 1, màu nhỏ nhất còn dùng được là 2. "1" không dùng được vì cả A và E, hai đỉnh kề của G, đều đã mang màu 1. "3" bỏ qua màu 2 dù màu 2 vẫn hợp lệ cho G, trái với nguyên tắc luôn lấy màu nhỏ nhất. "4" đòi G bị chặn cả ba màu đầu, nhưng G chỉ có hai đỉnh kề nên nhiều nhất chặn được hai màu. "5" càng xa hơn, vì cả đồ thị này tô xong chỉ dùng tới ba màu.

Cùng phần 5

Suppose the graph G = (V,E) satisfies the conditions for the existence of an Eulerian cycle. The following is an algorithm for finding Euler cycle from the vertex X using stack: declare a stack S of characters (a vertex is labeled by a character) declare an empty array E (which will contain Euler cycle) push the vertex X to S while(S is not empty) {ch = top element of the stack S if ch is isolated then remove it from the stack and put it to E else select the first vertex Y (by alphabet order), which is adjacent to ch,push Y to S and remove the edge (ch,Y) from the graph } the last array E obtained is an Euler cycle of the graph Suppose a multigraph G is given below (view picture). Which of the followings is the Euler cycle from the vertex B, created by above algorithm?Có lời giảiCâu hỏiGiven the graph G = (V,E) and X is a vertex of G. Suppose there exists at least one Hamilton Cycle for the graph. The following is a backtracking algorithm for finding the first Hamilton cycle from the vertex X: declare an empty array H (which will contain Hamilton cycle) (1) Put the vertex X to H (2) Check if H is a Hamilton cycle then stop, else go to (3) (3) Consider the last vertex Y in H, if there is/are vertex(es) adjacent to Y, select the first adjacent vertex Z (by alphabet order) and put it to H. If there no adjacent vertex, remove Y from H and denote it as a bad selection (so you do not select it in the same way again). Go to (2). Suppose a G is given below (view picture). Which of the followings is the Hamilton cycle from the vertex A, created by above algorithm?Có lời giảiCâu hỏiWhat data structure is used for breadth first traversal of a graph?Có lời giảiCâu hỏiCả 48 câu của chủ đề48 câu

Xuất hiện trong 1 bộ đề