function [ D ] = adj2mssp(srcs, dsts, adj, sssp)
%ADJ2MSSP Solves the all-to-all shortest paths on adj

if(nargin < 4)
	error('Not enough input arguments.');
end

n = size(adj, 1);
if(length(srcs) ~= n || length(dsts) ~= n)
	error('Src/dst/adj size mismatch.');
end

src_idx = find(srcs > 0);
dst_idx = find(dsts > 0);
D_sub = mssp(src_idx, dst_idx, adj, sssp);
D = sparse(n, n);
D(src_idx, dst_idx) = D_sub;

end

