|
1 | | -# Dynamic (Weighted) Independent Set [](https://opensource.org/licenses/MIT) |
| 1 | +# DynWMIS — Dynamic Maximum (Weight) Independent Set |
2 | 2 |
|
3 | | -A dynamic graph algorithm is a data structure that supports edge insertions, deletions, and problem specific queries. While extensive research exists on dynamic algorithms for graph problems solvable in polynomial time, most of these algorithms have not been implemented or empirically evaluated. The open source framework addresses the NP-complete maximum weight as well as the maximum cardinality independent set problem in a dynamic setting, applicable to areas like dynamic map-labeling and vehicle routing. Specifically we introduce a novel local search technique called optimal neighborhood exploration. This technique creates independent subproblems that are solved to optimality, leading to improved overall solutions. Through numerous experiments, we assess the effectiveness of our approach and compare it with other state-of-the-art dynamic solvers. Our algorithm features a parameter, the subproblem size, that balances running time and solution quality. |
| 3 | +[](https://opensource.org/licenses/MIT) |
| 4 | +[](https://en.cppreference.com/w/cpp/17) |
| 5 | +[](https://cmake.org/) |
| 6 | +[](https://github.com/DynGraphLab/DynWMIS) |
| 7 | +[](https://github.com/DynGraphLab/DynWMIS) |
| 8 | +[](https://github.com/DynGraphLab/homebrew-dyngraphlab) |
| 9 | +[](https://github.com/DynGraphLab/DynWMIS/stargazers) |
| 10 | +[](https://github.com/DynGraphLab/DynWMIS/issues) |
| 11 | +[](https://github.com/DynGraphLab/DynWMIS/commits) |
| 12 | +[](https://arxiv.org/abs/2407.06912) |
| 13 | +[](https://www.uni-heidelberg.de) |
4 | 14 |
|
5 | | -Installation Notes |
6 | | -===== |
7 | | -## Downloading: |
8 | | -You can download the project with the following command line: |
| 15 | +<p align="center"> |
| 16 | + <img src="./img/dynwmis-banner.png" alt="DynWMIS Banner" width="600"/> |
| 17 | +</p> |
9 | 18 |
|
10 | | -```console |
11 | | -git clone https://github.com/DynGraphLab/DynWMIS |
12 | | -``` |
13 | | - |
14 | | -## Compiling: |
15 | | -Just type in the main directory of the project: |
16 | | -```console |
17 | | -./compile_withcmake.sh |
18 | | -``` |
19 | | -In this case, all binaries, libraries and headers are in the folder ./deploy/ |
| 19 | +Part of the [DynGraphLab — Dynamic Graph Algorithms](https://github.com/DynGraphLab) open source framework. Developed at the [Algorithm Engineering Group, Heidelberg University](https://ae.ifi.uni-heidelberg.de). |
20 | 20 |
|
21 | | -Note that this script detects the amount of available cores on your machine and uses all of them for the compilation process. If you don't want that, set the variable NCORES to the number of cores that you would like to use for compilation. |
22 | | - |
23 | | -Alternatively use the standard cmake build process: |
24 | | -```console |
25 | | -mkdir build |
26 | | -cd build |
27 | | -cmake ../ -DCMAKE_BUILD_TYPE=Release |
28 | | -make |
29 | | -cd .. |
30 | | -``` |
31 | | -In this case, the binaries, libraries and headers are in the folder ./build |
| 21 | +## Description |
32 | 22 |
|
| 23 | +A fully dynamic algorithm for the NP-complete maximum weight and maximum cardinality independent set problem. We introduce *optimal neighborhood exploration*, a novel local search technique that creates independent subproblems solved to optimality, leading to improved overall solutions. Applications include dynamic map labeling and vehicle routing. |
33 | 24 |
|
| 25 | +The algorithm features a parameter (subproblem size) that balances running time and solution quality. |
34 | 26 |
|
35 | | -Graph Format |
36 | | -===== |
37 | | -The graph format used is a simple edge list. The first line is a # followed by two numbers `n` and `m` which specify the number of nodes of your input `n` and the number of edges/updates your perform. If there is a third number that equals `1` in this line, then the graph is weighted. If the graph is weighted, then the next `n` lines will specify vertex weights (one line per vertex). In both cases the `m` lines that follow, each line specifies an update. An update is either an edge insertion or deletion. An edge insertion is specified by a `1` followed by two numbers `u` and `v` which specify the edge `{u,v}` to be inserted. An edge deletion is specified by a `0` followed by two numbers `u` and `v` which specify the edge `{u,v}` to be deleted. In general, vertex IDs start at 1. Updates of vertex weights are in principle also possible, but not supported by the current implementation. |
| 27 | +## Install via Homebrew |
38 | 28 |
|
39 | | -To convert a METIS graph file (like the ones available here https://dimacs10.github.io/) into the graph sequence format used by our program, you can use the following command: |
40 | 29 | ```console |
41 | | -./deploy/convert_metis_seq nameofgraphfile.graph |
| 30 | +brew install DynGraphLab/dyngraphlab/dynwmis |
42 | 31 | ``` |
43 | | -The output will be store `nameofgraphfile.graph.seq`; For example, |
| 32 | + |
| 33 | +Then run: |
44 | 34 | ```console |
45 | | -./deploy/convert_metis_seq examples/3elt.graph |
| 35 | +dynwmis FILE --algorithm=DynamicOneFast |
46 | 36 | ``` |
47 | | -Creates the file `examples/3elt.graph.seq`; Note, however, that this results in insertion only sequences. |
48 | 37 |
|
| 38 | +## Installation (from source) |
49 | 39 |
|
50 | | -Running Programs |
51 | | -===== |
52 | | -Running the algorithm is done as follows: |
53 | | - |
54 | | -Running the algorithm on a graph file `3elt.graph.seq` with the algorithm `DynamicOneFast`: |
55 | 40 | ```console |
56 | | -./deploy/dynwmis examples/3elt.graph.seq --algorithm=DynamicOneFast |
| 41 | +git clone https://github.com/DynGraphLab/DynWMIS |
| 42 | +cd DynWMIS |
| 43 | +./compile_withcmake.sh |
57 | 44 | ``` |
58 | 45 |
|
59 | | -Running the algorithm on a graph file `3elt.graph.seq` with the algorithm `DynamicOneFast`: |
| 46 | +All binaries are placed in `./deploy/`. Alternatively, use the standard CMake process: |
| 47 | + |
60 | 48 | ```console |
61 | | -./deploy/dynwmis examples/4elt.graph.seq --algorithm=DynamicOneFast |
| 49 | +mkdir build && cd build |
| 50 | +cmake ../ -DCMAKE_BUILD_TYPE=Release |
| 51 | +make && cd .. |
62 | 52 | ``` |
63 | 53 |
|
64 | | -The following commands should reproduce the values of the `4elt` instance in Table 1 of our paper: |
| 54 | +## Usage |
65 | 55 |
|
66 | 56 | ```console |
67 | | -for g in `seq 1 10`; do ./deploy/dynwmis examples/4elt.graph.seq --algorithm=DynamicOneFast --seed=$g | grep weight | grep -v spec; done | awk '{if($NF>max){max=$NF}}END{print max}' |
| 57 | +dynwmis FILE [options] |
68 | 58 | ``` |
69 | 59 |
|
| 60 | +### Examples |
| 61 | + |
70 | 62 | ```console |
71 | | -for g in `seq 1 10`; do ./deploy/dynwmis examples/4elt.graph.seq --algorithm=DynamicOneStrong --seed=$g | grep weight | grep -v spec; done | awk '{if($NF>max){max=$NF}}END{print max}' |
| 63 | +./deploy/dynwmis examples/4elt.graph.seq --algorithm=DynamicOneFast |
| 64 | +./deploy/dynwmis examples/4elt.graph.seq --algorithm=DynamicOneStrong |
72 | 65 | ``` |
73 | 66 |
|
| 67 | +### Converting METIS graphs |
74 | 68 |
|
| 69 | +To convert a METIS graph file into the dynamic sequence format: |
| 70 | + |
| 71 | +```console |
| 72 | +./deploy/dynwmis_convert_metis_seq nameofgraphfile.graph |
| 73 | +``` |
75 | 74 |
|
76 | | -Licence |
77 | | -===== |
78 | | -The program is licenced under MIT licence. |
79 | | -If you publish results using our algorithms, please acknowledge our work by quoting the following paper: |
| 75 | +## Input Format |
80 | 76 |
|
| 77 | +Edge list format. The first line starts with `# n m [weighted]` where `n` is the number of nodes, `m` is the number of updates, and an optional `1` indicates a weighted graph. For weighted graphs, the next `n` lines specify vertex weights. Updates follow: `1 u v` for edge insertion, `0 u v` for edge deletion. Vertex IDs start at 1. |
81 | 78 |
|
82 | 79 | ``` |
83 | | -@misc{borowitz2024optimalneighborhoodexplorationdynamic, |
84 | | - title={Optimal Neighborhood Exploration for Dynamic Independent Sets}, |
85 | | - author={Jannick Borowitz and Ernestine Großmann and Christian Schulz}, |
86 | | - year={2024}, |
87 | | - eprint={2407.06912}, |
88 | | - archivePrefix={arXiv}, |
89 | | - primaryClass={cs.DS}, |
90 | | - url={https://arxiv.org/abs/2407.06912}, |
91 | | -} |
| 80 | +# 100 500 |
| 81 | +1 1 2 |
| 82 | +1 3 4 |
| 83 | +0 1 2 |
92 | 84 | ``` |
93 | 85 |
|
| 86 | +For weighted graphs: |
| 87 | +``` |
| 88 | +# 100 500 1 |
| 89 | +10 |
| 90 | +20 |
| 91 | +... |
| 92 | +1 1 2 |
| 93 | +``` |
94 | 94 |
|
95 | | - |
| 95 | +## License |
| 96 | + |
| 97 | +The program is licensed under the [MIT License](https://opensource.org/licenses/MIT). |
| 98 | +If you publish results using our algorithms, please acknowledge our work by citing the following paper: |
| 99 | + |
| 100 | +```bibtex |
| 101 | +@inproceedings{DBLP:conf/alenex/BorowitzG025, |
| 102 | + author = {Jannick Borowitz and |
| 103 | + Ernestine Gro{\ss}mann and |
| 104 | + Christian Schulz}, |
| 105 | + title = {Optimal Neighborhood Exploration for Dynamic Independent Sets}, |
| 106 | + booktitle = {27th Symposium on Algorithm Engineering and Experiments, {ALENEX} 2025}, |
| 107 | + pages = {1--14}, |
| 108 | + publisher = {{SIAM}}, |
| 109 | + year = {2025}, |
| 110 | + doi = {10.1137/1.9781611978339.1} |
| 111 | +} |
| 112 | +``` |
0 commit comments