libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bipartite.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
12 #ifndef FIRM_ADT_BIPARTITE_H
13 #define FIRM_ADT_BIPARTITE_H
14 
15 #include <stdio.h>
16 
17 #include "../begin.h"
18 
28 typedef struct bipartite_t bipartite_t;
29 
32 FIRM_API bipartite_t *bipartite_new(unsigned n_left, unsigned n_right);
34 FIRM_API void bipartite_free(bipartite_t *gr);
36 FIRM_API void bipartite_add(bipartite_t *gr, unsigned i, unsigned j);
38 FIRM_API void bipartite_remv(bipartite_t *gr, unsigned i, unsigned j);
41 FIRM_API int bipartite_adj(bipartite_t const *gr, unsigned i, unsigned j);
43 FIRM_API void bipartite_matching(bipartite_t const *gr, int *matching);
44 
48 FIRM_API void bipartite_dump_f(FILE *f, bipartite_t const *gr);
49 
53 FIRM_API void bipartite_dump(char const *name, bipartite_t const *gr);
54 
57 #include "../end.h"
58 
59 #endif
void bipartite_matching(bipartite_t const *gr, int *matching)
Solve bipartite matching problem.
void bipartite_free(bipartite_t *gr)
Free memory occupied by bipartite matching problem.
void bipartite_remv(bipartite_t *gr, unsigned i, unsigned j)
Remove edge from i (on the left side) to j (on the right side)
void bipartite_dump(char const *name, bipartite_t const *gr)
Dumps a bipartite graph to file name.
struct bipartite_t bipartite_t
internal representation of bipartite matching problem
Definition: bipartite.h:28
void bipartite_add(bipartite_t *gr, unsigned i, unsigned j)
Add edge from i (on the left side) to j (on the right side)
bipartite_t * bipartite_new(unsigned n_left, unsigned n_right)
Create new bipartite matching problem with n_left elements on left side and n_right elements on right...
void bipartite_dump_f(FILE *f, bipartite_t const *gr)
Dumps a bipartite graph to a file stream.
int bipartite_adj(bipartite_t const *gr, unsigned i, unsigned j)
Return 1 if edge from i (on the left side) to j (on the right side) exists, 0 otherwise.