function [exitFlag exitMsg netStruct] = fa_shortestPath_km(netStruct, algorithmParameters, net2planParameters)

	% Algorithm for flow assignment problems which tries to route all traffic
	% by the shortest path using as cost per link its length in km.
	%
	% This algorithm has no specific parameters.
	
	%% Sanity checks
	assert(isfield(netStruct, 'linkTable'), 'A set of links is required');
	assert(isfield(netStruct, 'demandTable'), 'A set of demands is required');

	D = size(netStruct.demandTable, 1);
	P = D; % same number of paths as demads

	netStruct.routingMatrix = sparse(D, P);
	netStruct.pathList = cell(1,P);

	% for each demand add a path, and route all the traffic through it
	for d = 1:D

		ingressNodeId = netStruct.demandTable(d, 1);
		egressNodeId = netStruct.demandTable(d, 2);

		sequenceOfLinks = shortestPath(netStruct.linkTable, netStruct.linkLengthInKm, ingressNodeId, egressNodeId);
		assert(~isempty(sequenceOfLinks), sprintf('No path from %d to %d', ingressNodeId, egressNodeId));

		netStruct.pathList{d} = sequenceOfLinks; % set the path
		netStruct.routingMatrix(d,d) = 1; % route all the demand's traffic in it

	end

	exitFlag = 0;
	exitMsg = 'OK!';
		

end