CARS
Defines | Functions | Variables

/home/nicola/Dropbox/Progetto SOL/CARS_terfram/src/test-shpath.c File Reference

test shortest path More...

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <mcheck.h>
#include "dgraph.h"
#include "shortestpath.h"

Defines

#define NODESFILE   "./CITY.txt"
#define ARCSFILE   "./TUSCANY.map"

Functions

static void stampadist (graph_t *g, int n, double *dist)
static void stampaprec (graph_t *g, int n, unsigned int *prec)
static void calcola_e_stampa_rotte (graph_t *g, unsigned int n1, unsigned int *prec)
int main (void)

Variables

static char * citta []
static char * strade []

Detailed Description

test shortest path

Author:
lso11

Define Documentation

#define ARCSFILE   "./TUSCANY.map"

file dati mappa toscana: file archi

Referenced by main().

#define NODESFILE   "./CITY.txt"

file dati mappa toscana: file nodi

Referenced by main().


Function Documentation

static void calcola_e_stampa_rotte ( graph_t g,
unsigned int  n1,
unsigned int *  prec 
) [static]

stampa in formato stringa le rotte da n1 a tutti gli altri nodi del grafo

Parameters:
ggrafo di riferimento
n1nodo di partenza delle rotte
precvettore delle precedenze calcolato da dijkstra

References shpath_to_string().

Referenced by main().

int main ( void  )
static void stampadist ( graph_t g,
int  n,
double *  dist 
) [static]

stampa formattata del vettore delle distanze calcolato da dijkstra()

Parameters:
ggrafo di riferimento
nnodo di partenza
distvettore delle distanze in km

References INFINITY, and graph::size.

Referenced by main().

static void stampaprec ( graph_t g,
int  n,
unsigned int *  prec 
) [static]

stampa formattata del vettore delle precedenze calcolato da dijkstra()

Parameters:
ggrafo di riferimento
nnodo di partenza
precvettore delle precedenze

References graph::size.

Referenced by main().


Variable Documentation

char* citta[] [static]
Initial value:
 {
    "PISA",
    "LUCCA",
    "LIVORNO",
    "LA SPEZIA",
    "AREZZO",
    "PRATO",
    "FIRENZE",
    NULL,
}

nodi primo grafo di test

Referenced by main().

char* strade[] [static]
Initial value:
 {
  "PRATO:FIRENZE:24.9",
  "PISA:LUCCA:24.8",
  "LUCCA:PISA:24.8",
  "PISA:LIVORNO:22.3",
  "LIVORNO:PISA:22.3",
  "LA SPEZIA:PISA:80.0",
  "PISA:LA SPEZIA:80.0",
  "FIRENZE:AREZZO:77.9",
  "AREZZO:FIRENZE:77.9",
  "PRATO:LUCCA:57.9",
  "LUCCA:PRATO:57.9",
  "FIRENZE:PRATO:24.9",
  NULL,
}

archi primo grafo di test

Referenced by main().