src/main/java/com/mxgraph/analysis/mxGraphStructure.java
public static boolean isSimple(mxAnalysisGraph aGraph)
	{
		Object parent = aGraph.getGraph().getDefaultParent();
		Object[] edges = aGraph.getChildEdges(parent);

		// self loop detection
		for (int i = 0; i < edges.length; i++)
		{
			Object currEdge = edges[i];

			if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge, false))
			{
				return false;
			}

			for (int j = 0; j < edges.length; j++)
			{
				Object currEdge2 = edges[j];

				if (currEdge != currEdge2)
				{
					if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge2, true)
							&& aGraph.getTerminal(currEdge, false) == aGraph.getTerminal(currEdge2, false))
					{
						return false;
					}

					if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge2, false)
							&& aGraph.getTerminal(currEdge, false) == aGraph.getTerminal(currEdge2, true))
					{
						return false;
					}
				}
			}
		}

		return true;
	}
/**
	 * @param aGraph
	 * @return true if the graph is simple (no self loops and no multiple edges)
	 */
@param aGraph
@return true if the graph is simple (no self loops and no multiple edges)
@param aGraph @return true if the graph is simple ( no self loops and no multiple edges )
public static boolean isSimple(mxAnalysisGraph aGraph)
	{
		Object parent = aGraph.getGraph().getDefaultParent();
		Object[] edges = aGraph.getChildEdges(parent);
		for (int i = 0; i < edges.length; i++)
		{
			Object currEdge = edges[i];
			if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge, false))
			{
				return false;
			}
			for (int j = 0; j < edges.length; j++)
			{
				Object currEdge2 = edges[j];
				if (currEdge != currEdge2)
				{
					if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge2, true)
							&& aGraph.getTerminal(currEdge, false) == aGraph.getTerminal(currEdge2, false))
					{
						return false;
					}
					if (aGraph.getTerminal(currEdge, true) == aGraph.getTerminal(currEdge2, false)
							&& aGraph.getTerminal(currEdge, false) == aGraph.getTerminal(currEdge2, true))
					{
						return false;
					}
				}
			}
		}
		return true;
	}
public static boolean isSimple ( mxAnalysisGraph aGraph ) { Object parent = aGraph . getGraph ( ) . getDefaultParent ( ) ; Object [ ] edges = aGraph . getChildEdges ( parent ) ; for ( int i = 0 ; i < edges . length ; i ++ ) { Object currEdge = edges [ i ] ; if ( aGraph . getTerminal ( currEdge , true ) == aGraph . getTerminal ( currEdge , false ) ) { return false ; } for ( int j = 0 ; j < edges . length ; j ++ ) { Object currEdge2 = edges [ j ] ; if ( currEdge != currEdge2 ) { if ( aGraph . getTerminal ( currEdge , true ) == aGraph . getTerminal ( currEdge2 , true ) && aGraph . getTerminal ( currEdge , false ) == aGraph . getTerminal ( currEdge2 , false ) ) { return false ; } if ( aGraph . getTerminal ( currEdge , true ) == aGraph . getTerminal ( currEdge2 , false ) && aGraph . getTerminal ( currEdge , false ) == aGraph . getTerminal ( currEdge2 , true ) ) { return false ; } } } } return true ; }
@param aGraph
 @return true if the graph is simple (no self loops and no multiple edges)
@param aGraph @return true if the graph is simple ( no self loops and no multiple edges )
// self loop detection