function R2 = LEM_conn_roads(roads)
%

V = roads.vertexes;
E = roads.edges;
EE = [E; E(end:-1:1,:)];
indexes1 = EE(:,1);
indexes2 = EE(:,2);
num_edges = length(EE(:,1));
weights = zeros(num_edges,1);
for e = 1:num_edges
    weights(e) = norm(V(indexes1(e),:)-V(indexes2(e),:));
end
GG = digraph(indexes1,indexes2,weights);
GG.Nodes = array2table(V);
[bin,bins] = conncomp(GG,'Type','Weak');
idx = bins(bin)==max(bins);
SG = subgraph(GG,idx);
ee = table2array(SG.Edges);
vv = table2array(SG.Nodes);
R.vertexes = vv;
R.edges = ee;
R2 = LEM_clean_roads(R);
