treeswhich is essentially generalization of linked listscan be generalized for graphs in language such as javaa class graph might have the following as an internal classclass vertex string namevertex[neighboursdouble[weightswhen each vertex is createdan array neighbours big enough to accommodate (pointers toall its neighbours is allocatedwith (for weighted graphsan equal sized array weights to accommodate the associated weights we then place the neighbours of each vertex into those arrays in some arbitrary order any entries in the neighbours array that are not needed will hold null pointer as usual for examplethe above weighted graph would be represented as followswith each weight shown following the associated pointer relations between graphs many important theorems about graphs rely on formal definitions of the relations between themso we now define the main relevant concepts two graphs are said to be isomorphic if they contain the same number of vertices with the same pattern of adjacencyi there is bijection between their vertices which preserves the adjacency relations subgraph of graph is defined as any graph that has vertex set which is subset of that of gwith adjacency relations which are subset of those of converselya supergraph of graph is defined as any graph which has as subgraph finallya graph is said to contain another graph if there exists subgraph of that is either or isomorphic to subdivision of an edge with endpoints and is simply the pair of edges with endpoints and wand with endpoints and vfor some new vertex the reverse operation of smoothing removes vertex with exactly two edges and leaving an edge connecting the two adjacent vertices and