Connections are the directed edges of the campus navigation graph. Each connection links an origin node to a destination node and carries the walking distance between them in meters. The 50 pre-loaded edges form a sequential chain from node 1 (Entrada Universidad) to node 51 (Escalera Cafetería), which the routing engine traverses using Dijkstra’s algorithm. You can extend the graph by posting new connections viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jcofles/Proyecto-web/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/nodos/conectar.
Connection object
Auto-incremented edge identifier.
ID of the origin node. References the
nodos table.ID of the destination node. References the
nodos table. Must differ from nodo_origen_id.Walking distance between the two nodes in meters, calculated using the Haversine formula (Earth radius = 6 371 000 m).
List all connections
Returns the complete set of 50 in-memory directed edges that form the current campus graph.The full response contains all 50 edges. The example above shows a representative subset. Total graph length is approximately 473 meters from node 1 to node 51.
Connect two nodes
Creates a new directed edge between two existing nodes. The connection is persisted to theconexiones pivot table and will be included in future calls to GET /api/conexiones. Optionally creates the inverse edge in the same request.
ID of the origin node. Must exist in the
nodos table.ID of the destination node. Must exist in the
nodos table. Must differ from nodo_origen_id.Distance in meters between the two nodes. Must be
>= 0. Typically computed with the Haversine formula from the nodes’ latitude/longitude coordinates.When
true, a second edge is created from nodo_destino_id back to nodo_origen_id with the same distance. Defaults to false (directed edge only). Uses syncWithoutDetaching, so calling this endpoint again for the same pair will not create duplicate edges.Validation errors — 422 Unprocessable Entity
| Field | Rule |
|---|---|
nodo_origen_id | Required, integer, must exist in nodos |
nodo_destino_id | Required, integer, must exist in nodos, ≠ origen |
distancia | Required, numeric, ≥ 0 |
bidireccional | Optional, boolean |
Haversine distance formula
All pre-loaded edge distances are calculated with the Haversine formula, which gives the great-circle distance between two points on a sphere:GET /api/nodos) and supply the result as the distancia field. The API does not auto-compute distance from coordinates.