the problemmuch discussed by the townsfolkwas to find way to walk across all seven bridges without recrossing any of them we won' recount euler' solution to the problemit turns out that there is no such path howeverthe key to his solution was to represent the problem as graphwith land areas as vertices and bridges as edgesas shown in figure - this is perhaps the first example of graph being used to represent problem in the real world representing graph in program it' all very well to think about graphs in the abstractas euler and other mathematicians did until the invention of the computerbut we want to represent graphs by using computer what sort of software structures are appropriate to model graphwe'll look at vertices firstand then at edges vertices in very abstract graph program you could simply number the vertices to - (where is the number of verticesyou wouldn' need any sort of variable to hold the verticesbecause their usefulness would result from their relationships with other vertices in most situationshowevera vertex represents some real-world objectand the object must be described using data items if vertex represents city in an airline route simulationfor exampleit may need to store the name of the cityits altitudeits locationand other such information thus it' usually convenient to represent vertex by an object of vertex class our example programs store only letter (like )used as label for identifying the vertexand flag for use in search algorithmsas we'll see later here' how the vertex class looksclass vertex public char label/label ( ' 'public boolean wasvisitedpublic vertex(char lablabel labwasvisited false/constructor /end class vertex vertex objects can be placed in an array and referred to using their index number in our