The LevAWC Project
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Data Structures | Typedefs | Functions
algo.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <assert.h>
#include <float.h>
#include <math.h>
#include "slist.h"
#include "queue.h"
#include "graph.h"

Go to the source code of this file.

Data Structures

struct  DspVertexdata_
 
struct  MstVertexdata_
 
struct  TspVertexdata_
 
struct  BfsVertexdata_
 
struct  DfsVertexdata_
 

Typedefs

typedef struct DspVertexdata_DspVertexdata
 
typedef struct MstVertexdata_MstVertexdata
 
typedef struct TspVertexdata_TspVertexdata
 
typedef struct BfsVertexdata_BfsVertexdata
 
typedef struct DfsVertexdata_DfsVertexdata
 

Functions

int ALGOdsp (Graph gr, const DspVertexdata start, Slist *spath, int(*match)(const void *key1, const void *key2))
 
int ALGOmst (Graph gr, const MstVertexdata start, Slist *span, int(*match)(const void *key1, const void *key2))
 
int ALGOtsp (Slist vertices, const TspVertexdata start, Slist *tour, int(*match)(const void *key1, const void *key2))
 
int ALGObfs (Graph gr, const BfsVertexdata start, Slist *hops, int(*match)(const void *key1, const void *key2))
 
int ALGOdfs (Graph gr, Slist *ordered)
 

Typedef Documentation

typedef struct BfsVertexdata_ * BfsVertexdata

A data structure for vertices in a breadth-first search

typedef struct DfsVertexdata_ * DfsVertexdata

A data structure for vertices in a depth-first search

typedef struct DspVertexdata_ * DspVertexdata

A data structure for finding the shortest path between vertices in a graph

typedef struct MstVertexdata_ * MstVertexdata

A data structure for finding the minimum spanning tree in a graph

typedef struct TspVertexdata_ * TspVertexdata

A data structure for finding the travelling salesmans route in a graph

Function Documentation

int ALGObfs ( Graph  gr,
const BfsVertexdata  start,
Slist hops,
int(*)(const void *key1, const void *key2)  match 
)

Do a breadth-first search in a graph

Definition at line 380 of file algo.c.

int ALGOdfs ( Graph  gr,
Slist ordered 
)

Do a depth-first search in a graph

Definition at line 499 of file algo.c.

int ALGOdsp ( Graph  gr,
const DspVertexdata  start,
Slist spath,
int(*)(const void *key1, const void *key2)  match 
)

Find shortest path with Dijkstra's algorithm

Definition at line 45 of file algo.c.

int ALGOmst ( Graph  gr,
const MstVertexdata  start,
Slist span,
int(*)(const void *key1, const void *key2)  match 
)

Find minimal spanning tree with Prims's algorithm

Definition at line 161 of file algo.c.

int ALGOtsp ( Slist  vertices,
const TspVertexdata  start,
Slist tour,
int(*)(const void *key1, const void *key2)  match 
)

Find route for Travelling Salesman

Definition at line 272 of file algo.c.