A tree is a specialized case of a graph. A tree is a connected graph with no circuits and no self loops. A graph consists of 3 sets - vertices, edges and a set representing relations between vertices and edges i.e. V = (a, b, c) e = (e1, e2, e3) and x = ((a,b,e1), (b,c,e2), (a,c,e3)) represents a graph where e1 joins a and b and so on. A circuit is alternating sequence of edges and vertices where in edges are not repeated, vertices may be and starting and ending vertices are the same e.g. A e1 b e2 c e3 a means a connected to b, b to c and c to a. This forms a loop. A self loop is a vertex looping on to itself. As a tree does not contain any loops and is still connected, it is also called a minimally connected graph i.e. There is just one path between any 2 vertices.
Difference between a Tree and a Graph? Tree: A tree is a specialized case of a graph. A tree is a connected graph with no circuits and no self loops. A tree does not contain any loops and is still connected, it is also called a minimally connected graph i.e. There is just one path between any 2 vertices.s Graph: A graph consists of 3 sets - vertices, edges and a set representing relations between vertices and edges i.e. V = (a, b, c) e = (e1, e2, e3) and x = ((a,b,e1), (b,c,e2), (a,c,e3)) represents a graph where e1 joins a and b and so on.
When cycles are present in tree or if violates parent child relationship of a tree,then it said to be a graph.Graphs are special case of tree.
The tree is a connected graph whereas graph is not a connected graph.