Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

API Web para buscar o menor caminho entre dois vértices de um grafo

License

Notifications You must be signed in to change notification settings

eduardoklosowski-archive/grafo-curto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafo Curto

API Web para buscar o menor caminho entre dois vértices de um grafo.

Exemplo

Executar servidor:

python grafo.py

Fazer requisição:

http :8000 graph:=@content source=a destination=b

Requisição

{
  "source": "a",
  "destination": "b",
  "graph": {
    "vertexes": [
      {"id": "a", "name": "a"},
      {"id": "b", "name": "b"}
    ],
    "edges": [
      {"id": 1, "source": "a", "destination": "b", "weight": 2},
      {"id": 2, "source": "a", "destination": "b", "weight": 1}
    ]
  }
}

Resposta

{
  "source": "a",
  "destination": "b",
  "has_path": true,
  "path": [
    {"id": 2, "source": "a", "destination": "b", "weight": 1}
  ],
  "cost": 1
}

About

API Web para buscar o menor caminho entre dois vértices de um grafo

Topics

Resources

License

Stars

Watchers

Forks

Languages