Skip to content
Snippets Groups Projects
Commit 0d05e93b authored by Jaime Arias's avatar Jaime Arias
Browse files

doc: update README

parent de4e8559
No related branches found
Tags v2.4.2rc3
No related merge requests found
Pipeline #8806 passed with stages
in 7 minutes and 36 seconds
......@@ -11,8 +11,7 @@ optimal solution of a graph from a `.dot` file. It provides the following
functionalities:
1. **Generate a Random Graph**: Users can specify the number of nodes, edges,
and labels to generate a random, deterministic, and connected graph. This is
achieved using the `generateRandomGraph` function in `Graph.cpp`.
and labels to generate a random, deterministic, and connected graph.
2. **Extract Optimal Solution from a .dot File**: Users can provide a `.dot`
file to extract and optimize the graph.
......@@ -20,14 +19,13 @@ file to extract and optimize the graph.
After generating the graph or loading it from a file, the program performs the
following steps:
1. **Generate Regular Expression of the Graph**: The
`RegularExpressionGeneration` function in `graph.cpp` is used to generate the
1. **Generate Regular Expression of the Graph**: The tool generates the
regular expression of the graph.
2. **Extract All Paths from the Regular Expression**: All the paths of the graph
are extracted from the regular expression.
3. **Pass to the Linear Program**:
3. **Pass to the Integer Linear Program**:
- **Variables**: Paths of the graph.
- **Constraints**: Labels representing transitions in the graph.
......@@ -54,7 +52,8 @@ the selected paths.
Make sure to install the necessary dependencies before running the program:
- `gcc` >= 9.3.0
- `cmake`
- `cmake` >= 3.18
- `ninja`
## Build
......@@ -83,9 +82,9 @@ cd assets
To generate a random graph, use the following options:
```sh
./optlp --nb-nodes <n> \
--nb-edges <m> \
--nb-labels <l>
./optlp random --nb-nodes <n> \
--nb-edges <m> \
--nb-labels <l>
```
where:
......@@ -97,7 +96,7 @@ where:
**Example:**
```sh
./optlp --nb-nodes 200 --nb-edges 100 --nb-labels 20
./optlp random --nb-nodes 200 --nb-edges 100 --nb-labels 20
```
### Extracting the Optimal Solution from a .dot File
......@@ -106,18 +105,18 @@ To extract the optimal solution of a graph from a `.dot` file, use the following
option:
```sh
./optlp --input-file <filename.dot> --output-folder <foldername>
./optlp from-file --input-file <filename.dot> --output-folder <folder name>
```
where:
- `--input-file <filename.dot>`: Specifies the .dot file containing the graph.
- `--output-folder <foldername>`: Specifies the folder containing the result.
- `--output-folder <folder name>`: Specifies the folder containing the result.
**Example:**
```sh
./optlp --input-file ./toys_examples/graph3.dot --output-folder ./result/
./optlp from-file --input-file ./toys_examples/graph3.dot --output-folder ./result/
```
### Help
......@@ -132,9 +131,14 @@ display a help message with usage instructions.
The help message will display the following:
```sh
/**************************************************************/
/******************** help ********************/
/ -To generate a random graph: use the options --nb-nodes <n> --nb-edges <m> --nb-labels <l>
-To extract the optimal solution of a .dot file: use the option -d <filename.dot>
/**************************************************************/
❯ ./assets/optlp --help
OptLP: A tool to find the minimum number of shortest paths that cover all system actions
Usage: ./assets/optlp [OPTIONS] [SUBCOMMAND]
Options:
-h,--help Print this help message and exit
Subcommands:
random Generate a random LTS
from-file Load an LTS from a dot file
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment