https://github.com/johnfercher/medium-logistic
https://github.com/johnfercher/medium-logistic
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnfercher/medium-logistic
- Owner: johnfercher
- License: mit
- Created: 2024-09-06T21:50:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T14:44:44.000Z (over 1 year ago)
- Last Synced: 2026-03-27T18:59:08.605Z (3 months ago)
- Language: Jupyter Notebook
- Size: 192 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# medium-logistic
## Run
### 1. Build Dockers
```bash
make build-docker-api
make build-docker-neo4j
```
### 2. Build Frontend
```bash
cd frontend
npm install
```
### 3. Run
```bash
make run # Terminal A - Blocking
npm run server # Terminal B - Blocking
```
## Queries
```cypher
MATCH (source:City {id: 'maceio'}), (target:City {id: 'sao_paulo'})
CALL gds.shortestPath.dijkstra.stream('myGraph', {
sourceNode: source,
targetNodes: target,
relationshipWeightProperty: 'distance_km'
})
YIELD index, sourceNode, targetNode, totalCost, nodeIds, costs, path
RETURN
index,
gds.util.asNode(sourceNode).name AS sourceNodeName,
gds.util.asNode(targetNode).name AS targetNodeName,
totalCost,
[nodeId IN nodeIds | gds.util.asNode(nodeId).name] AS nodeNames,
costs,
nodes(path) as path
ORDER BY index
```
```cypher
MATCH (a:City)-[r:road]->(b:City)
RETURN gds.graph.project(
'myGraph',
a,
b,
{ relationshipProperties: r { .distance_km } }
)
```