Skip to content

Commit ab94bc8

Browse files
author
Jegors Čemisovs
committed
Updated README.md
1 parent 8903a9a commit ab94bc8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ There are implementations and tests for two algorithms:
1010
The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You
1111
can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports.
1212

13-
## How to use the algorithms in your program
13+
## Demo. Graph Shell
1414

15-
The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex
16-
and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance.
17-
18-
To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module.
15+
To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select [one of three build-in graph samples](#Graph-Samples) and search for a path using two algorithms. The source code of the program is located in `graph-shell` module.
1916

2017
[![asciicast](https://asciinema.org/a/468058.svg)](https://asciinema.org/a/468058)
2118

@@ -25,6 +22,11 @@ These algorithms used in the [Hypermetro](https://rabestro.github.io/hypermetro/
2522
utilized to find the optimal route in the metro schema.
2623

2724

25+
## How to use the algorithms in your program
26+
27+
The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex
28+
and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance.
29+
2830
### Example
2931
In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](docs/assets/complex.gif).
3032

@@ -73,6 +75,8 @@ routeTwo == ['D', 'E', 'F', 'G', 'C']
7375

7476
Tests are written in Groove language. For unit testing, the [Spock Framework](https://spockframework.org/) was used. To test the operation of the algorithms, the following sample graphs were created.
7577

78+
## Graph Samples
79+
7680
### Small Graph Sample
7781

7882
```groovy

0 commit comments

Comments
 (0)