lab_graphs
Gangnam-Style Graphs
PremadeGraphs Namespace Reference

This namespace contains code that builds three example graphs with the Graph library. More...

Functions

Vertex getStartVertex (string mapType)
 Returns a starting vertex for a path algorithm. More...
 
Vertex getEndVertex (string mapType)
 Returns a ending vertex for a path algorithm. More...
 
Graph createUSMap (bool isWeighted)
 Creates a map of some US cities. More...
 
Graph createEuropeMap (bool isWeighted)
 Creates a map of some European cities. More...
 
Graph createJapanMap (bool isWeighted)
 Creates a map of some Japanese cities. More...
 

Detailed Description

This namespace contains code that builds three example graphs with the Graph library.

The examples have real weights between cities in miles. Unfortunately, graphviz draws the nodes with a best-fit algorithm, so relative locations of cities are wrong.

Function Documentation

◆ getStartVertex()

Vertex PremadeGraphs::getStartVertex ( string  mapType)

Returns a starting vertex for a path algorithm.

Parameters
mapType- determines which map to get a starting vertex from. Possible values are "us", "europe", and "japan"
Returns
the starting vertex for a particular graph

◆ getEndVertex()

Vertex PremadeGraphs::getEndVertex ( string  mapType)

Returns a ending vertex for a path algorithm.

Parameters
mapType- determines which map to get a ending vertex from. Possible values are "us", "europe", and "japan"
Returns
the ending vertex for a particular graph

◆ createUSMap()

Graph PremadeGraphs::createUSMap ( bool  isWeighted)

Creates a map of some US cities.

Parameters
isWeighted- whether to show distance between cities in miles.
Returns
the graph of a few cities in the United States

◆ createEuropeMap()

Graph PremadeGraphs::createEuropeMap ( bool  isWeighted)

Creates a map of some European cities.

Parameters
isWeighted- whether to show distance between cities in miles.
Returns
the graph of a few cities in Europe

◆ createJapanMap()

Graph PremadeGraphs::createJapanMap ( bool  isWeighted)

Creates a map of some Japanese cities.

Parameters
isWeighted- whether to show distance between cities in miles.
Returns
the graph of a few cities in Japan