% test if a graph is connected

function ans=is_connected(G)
    V=size(G,1);
    if diameter(G)==V
	ans=0;
    else
	ans=1;
    end
return
