![]() ![]() Then we visit all the vertices that are the neighbors of $X$. There are mainly two ways to traverse a graph.īreadth First Search (BFS) starts at starting level-0 vertex $X$ of the graph $G$. Graph traversal is the problem of visiting all the vertices of a graph in some systematic order. Some applications of graph coloring include − Hence, the chromatic number of the graph is 3. Hence, we could color the graph by 3 colors. Then vertex $c$ is colored as red as no adjacent vertex of $c$ is colored red. As the adjacent vertices of vertex a are again adjacent, vertex $b$ and vertex $d$ are colored with different color, green and blue respectively. In the above figure, at first vertex $a$ is colored red. Repeat this step until all the vertices are colored. If all the adjacent vertices are colored with this color, assign a new color to it. Step 3 − Choose the next vertex and color it with the lowest numbered color that has not been colored on any vertices adjacent to it. Step 2 − Choose the first vertex and color it with the first color. Step 1 − Arrange the vertices of the graph in some order. The steps required to color a graph G with n number of vertices are as follows − Graph coloring problem is a NP Complete problem. The smallest number of colors required to color a graph G is called its chromatic number of that graph. The objective is to minimize the number of colors while coloring a graph. ![]() If two linear equations are given the same slope it means that they are parallel and if the product of two slopes m1*m2=-1 the two linear equations are said to be perpendicular.Graph coloring is the procedure of assignment of colors to each vertex of a graph G such that no adjacent vertices get same color. The slope of a line passing through points (x1,y1) and (x2,y2) is given by The slope, m, is here 1 and our b (y-intercept) is 7. If m, the slope, is negative the functions value decreases with an increasing x and the opposite if we have a positive slope.Īn equation such as y=x+7 is linear and there are an infinite number of ordered pairs of x and y that satisfy the equation. This form is called the slope-intercept form. f(2) means that we should find the value of our function when x equals 2.Ī function is linear if it can be defined byī is the value of the function when x equals zero or the y-coordinate of the point where the line crosses the y-axis in the coordinate plane. It is common to name a function either f(x) or g(x) instead of y. A function assigns exactly one output to each input of a specified type. In our example above, x is the independent variable and y is the dependent variable.Ī function is an equation that has only one answer for y for every x. The variable which we assign the value we call the independent variable, and the other variable is the dependent variable, since it value depends on the independent variable. In our equation y=x+7, we have two variables, x and y. We could instead have assigned a value for y and solved the equation to find the matching value of x. If we would have assigned a different value for x, the equation would have given us another value for y. If we in the following equation y=x+7 assigns a value to x, the equation will give us a value for y. ![]()
0 Comments
Leave a Reply. |