In computer science Computer science or computing science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems. It is frequently described as the systematic study of algorithmic processes that create, describe, and transform information. Computer science, a graph is an abstract data structure In computing, an abstract data type or abstract data structure is a mathematical model for a certain class of data structures that have similar behavior; or for certain data types of one or more programming languages that have similar semantics. An abstract data type is defined indirectly, only by the operations that may be performed on it and by that is meant to implement the graph In mathematics, a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected objects are represented by mathematical abstractions called vertices, and the links that connect some pairs of vertices are called edges. Typically, a graph is depicted in diagrammatic form as a set concept from mathematics Mathematics is the study of quantity, structure, space, and change. Mathematicians seek out patterns, formulate new conjectures, and establish truth by rigorous deduction from appropriately chosen axioms and definitions.
A graph data structure consists mainly of a finite (and possibly mutable) set In computer science, a set is an abstract data structure that can store certain values, without any particular order, and no repeated values. It is a computer implementation of the mathematical concept of a finite set of ordered pairs, called edges or arcs, of certain entities called nodes or vertices. As in mathematics, an edge (x,y) is said to point or go from x to y. The nodes may be part of the graph structure, or may be external entities represented by integer indices or references In computer science, a reference is a value that enables a program to indirectly access a particular data item, such as a variable or a record, in the computer's memory or in some other storage device. The reference is said to refer to the data item, and accessing that data is called dereferencing the reference.
A graph data structure may also associate to each edge some edge value, such as a symbolic label or a numeric attribute (cost, capacity, length, etc.).
Contents |
Operations
The basic operations provided by a graph data structure G usually include
adjacent(G, x,y): tests whether there is an edge from node x to node y.neighbors(G, x): lists all nodes y such that there is an edge from x to y.add(G, x,y): adds to G the edge from x to y, if it is not there.delete(G, x,y): removes the edge from x to y, if it is there.get_node_value(G, x): returns the value associated with the node x.set_node_value(G, x, a): sets the value associated with the node x to a.
Structures that associate values to the edges usually provide also
get_edge_value(G, x,y): returns the value associated to the edge (x,y).set_edge_value(G, x,y,v): sets the value associated to the edge (x,y) to v.
Representations
Different data structures for the representation of graphs are used in practice, e.g.:
- Adjacency list In graph theory, an adjacency list is the representation of all edges or arcs in a graph as a list - An adjacency list is implemented as an array of lists, with one list In computer science, a list or sequence is an abstract data structure that implements an ordered collection of values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence, that is, a tuple. Each instance of a value in the list is usually called an item, of destination nodes for each source node.
- Incidence list - A variant of the adjacency list that allows for the description of the edges at the cost of additional edges.
- Adjacency matrix In mathematics and computer science, an adjacency matrix is a means of representing which vertices of a graph are adjacent to which other vertices. Another matrix representation for a graph is the incidence matrix - A two-dimensional Boolean matrix, in which the rows and columns represent source and destination vertices and entries in the matrix indicate whether an edge exists between the vertices associated with that row and column.
- Incidence matrix - A two-dimensional Boolean matrix, in which the rows represent the vertices and columns represent the edges. The array entries indicate if both are related, i.e. incident.
Adjacency lists are preferred for sparse graphs; otherwise, an adjacency matrix is a good choice.
For graphs with some regularity in the placement of edges, a symbolic graph is a possible choice of representation.
Algorithms
Graph algorithms are a significant field of interest within computer science. Typical higher-level operations associated with graphs are: finding a path between two nodes, like depth-first search Depth-first search is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking and breadth-first search In graph theory, breadth-first search is a graph search algorithm that begins at the root node and explores all the neighboring nodes. Then for each of those nearest nodes, it explores their unexplored neighbor nodes, and so on, until it finds the goal and finding the shortest path from one node to another, like Dijkstra's algorithm Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1959, is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing. An equivalent algorithm was developed by Edward F. Moore in 1957. A solution to finding the shortest path from each node to every other node also exists in the form of the Floyd-Warshall algorithm In computer science, the Floyd–Warshall algorithm is a graph analysis algorithm for finding shortest paths in a weighted, directed graph. A single execution of the algorithm will find the shortest paths between all pairs of vertices. The Floyd–Warshall algorithm is named after Robert Floyd and Stephen Warshall; it is an example of dynamic.
A directed graph It differs from an ordinary or undirected graph, in that the latter is defined in terms of unordered pairs of vertices, which are usually called edges can be seen as a flow network In graph theory, a flow network is a directed graph where each edge has a capacity and each edge receives a flow. The amount of flow on an edge cannot exceed the capacity of the edge. Often in Operations Research, a directed graph is called a network, the vertices are called nodes and the edges are called arcs. A flow must satisfy the restriction, where each edge has a capacity and each edge receives a flow. The Ford-Fulkerson algorithm is used to find out the maximum flow from a source to a sink in a graph.
External links
- Algraf Project: Graphical tool to draw graphs, apply several algorithms to them and export to XML
- Boost Graph Library: a powerful C++ graph library
- Graph Data Structures (PDF, 280 KiB The kibibyte is a multiple of the unit byte for quantities of digital information. The binary prefix kibi means 1024, therefore 1 kibibyte is 1024bytes. The unit symbol for the kibibyte is KiB. The unit was established by the International Electrotechnical Commission in 2000 and has been accepted for use by all major standards organizations. It)
- Graphviz - Graph Visualization Software (Open Source)
- Java Universal Network/Graph Framework (JUNG)
- Java Graph and algorithm API (Annas)
- NetworkX - a Python Graph package
- Perl graph routines
- Prefuse - Java framework for interactive data visualizations
- QuickGraph: Graph Data Structures And Algorithms for .NET
Categories: Graph theory | Graph data structures | Abstract data types
|
Jutia Group
The results plotted as the red line in Graph 4 [below] show that, in the baseline scenario, debt/GDP ratios rise rapidly in the next decade, exceeding 300% ...
and more »
