To avoid this specify the shapes you want to layout (i.e. only the groups you want to layout and the edges which connect them). Take a look at the Document Object Model -> Groups -> Group Layout example (and especially on the LayoutGroups method) which comes with the diagramming component for a sample implementation.
Best Regards,Nevron Support Team