Technical image processing isn't my big thing, but I'll try.
inpict=rgb2gray(imread('edges.jpg'));
tpict=medfilt2(inpict,[3 3])>225;
majorboundary=~bwareafilt(~tpict,1,'largest');
reduced=~bwmorph(~majorboundary,'thin',Inf);
thisdelta=1;
while thisdelta>0
lastcopy=reduced;
reduced=reduced | bwmorph(~reduced,'endpoints');
err=abs(lastcopy-reduced);
thisdelta=sum(err(:));
end
imshow(reduced)
Yields this:
One problem with this approach is that it will also remove any closed edges which are not connected to the main group of edges. Providing that the prefiltering/thresholding step can extract a clear representation of the edges, then skipping the bwareafilt() step should avoid removing unconnected closed edges. In my hasty filtering/thresholding example, a lot of details did not survive to begin with. As I mentioned, I'm assuming you either have a better copy of the image or have already managed to reduce it to a binary image of sufficient accuracy. Omitting the bwareafilt() step gives us this:
Also, even if the filtering/thresholding is good and isolated loops are preserved, this method does not remove branches that terminate in a closed loop (see lower right).
Furthermore, note the behavior near the image boundary. If the image boundary is to be considered an edge, then perhaps adding 1px of temporary padding to the image will help preserve edges which meet the image boundary.