public void oneSpanningTree(mxAnalysisGraph aGraph, boolean forceConnected, boolean forceSimple) throws StructuralException
	{
		mxGraph graph = aGraph.getGraph();

		boolean isSimple = mxGraphStructure.isSimple(aGraph);
		boolean isConnected = mxGraphStructure.isConnected(aGraph);

		if (!isSimple)
		{
			if (forceSimple)
			{
				mxGraphStructure.makeSimple(aGraph);
			}
			else
			{
				throw new StructuralException("Graph is not simple.");
			}
		}

		if (!isConnected)
		{
			if (forceConnected)
			{
				mxGraphStructure.makeConnected(aGraph);
			}
			else
			{
				throw new StructuralException("Graph is not connected.");
			}
		}

		Object[] edges = aGraph.getChildEdges(graph.getDefaultParent());
		int edgeCount = edges.length;

		for (int i = 0; i < edgeCount; i++)
		{
			Object currEdge = edges[i];
			graph.removeCells(new Object[] { currEdge });

			if (!mxGraphStructure.isConnected(aGraph))
			{
				graph.addCell(currEdge);
			}
		}
	};