|
template<typename MatrixType , typename ArrayType > |
void | cusp::graph::breadth_first_search (const MatrixType &G, const typename MatrixType::index_type src, ArrayType &labels, bool mark_levels=true) |
| Performs a Breadth-first traversal of a graph starting from a given source vertex. More...
|
|
template<typename MatrixType , typename ArrayType > |
size_t | cusp::graph::connected_components (const MatrixType &G, ArrayType &components) |
| Computes the connected components of a graph. More...
|
|
template<class Array2dType , class ArrayType > |
void | cusp::graph::hilbert_curve (const Array2dType &coord, const size_t num_parts, ArrayType &parts) |
| Partition a graph using Hilbert curve. More...
|
|
template<typename MatrixType , typename ArrayType > |
size_t | cusp::graph::maximal_independent_set (const MatrixType &G, ArrayType &stencil, size_t k=1) |
| Compute maximal independent set of a graph. More...
|
|
template<typename MatrixType , typename ArrayType > |
MatrixType::index_type | cusp::graph::pseudo_peripheral_vertex (const MatrixType &G, ArrayType &levels) |
| Compute the pseudo-peripheral vertex of a graph. More...
|
|
template<typename MatrixType , typename PermutationType > |
void | cusp::graph::symmetric_rcm (const MatrixType &G, PermutationType &P) |
| Compute Reverse Cuthill-McKee reordering. More...
|
|
template<typename MatrixType , typename ArrayType > |
size_t | cusp::graph::vertex_coloring (const MatrixType &G, ArrayType &colors) |
| Performs a vertex coloring a graph. More...
|
|
template<typename MatrixType , typename ArrayType >
size_t cusp::graph::maximal_independent_set |
( |
const MatrixType & |
G, |
|
|
ArrayType & |
stencil, |
|
|
size_t |
k = 1 |
|
) |
| |
Compute maximal independent set of a graph.
- Template Parameters
-
MatrixType | Type of input matrix |
ArrayType | Type of components array |
- Parameters
-
G | symmetric matrix that represents a graph |
stencil | array to hold the MIS(k) |
k | radius of independence |
- Returns
- The number of MIS vertices computed for G.
- Overview
Computes a maximal independent set (MIS) a graph. The MIS is a set of vertices such that (1) no two vertices are adjacent and (2) it is not possible to add another vertex to thes set without violating the first property. The MIS(k) is a generalization of the MIS with the property that no two vertices in the set are joined by a path of k
edges or less. The standard MIS is therefore a MIS(1).
The MIS(k) is represented by an array of {0,1} values. Specifically, stencil[i]
is 1 if vertex i
is a member of the MIS(k) and 0 otherwise.
- See Also
- http://en.wikipedia.org/wiki/Maximal_independent_set
- Example
#include <iostream>
int main()
{
std::cout << "Computed " << num_mis << " MIS(1) vertices in the graph." <<
std::endl;
return 0;
}
- Examples:
- maximal_independent_set.cu.