You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,9 @@ There are implementations and tests for two algorithms:
10
10
The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You
11
11
can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports.
12
12
13
-
## How to use the algorithms in your program
13
+
## Demo. Graph Shell
14
14
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.
@@ -25,6 +22,11 @@ These algorithms used in the [Hypermetro](https://rabestro.github.io/hypermetro/
25
22
utilized to find the optimal route in the metro schema.
26
23
27
24
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
+
28
30
### Example
29
31
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).
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.
0 commit comments