public static VariableDependencyGraph getVariableDependencyGraph(
			Grammar grammar) {
		VariableDependencyGraph graph = new VariableDependencyGraph();
		initializeVariableDependencyGraph(graph, grammar);
		String[] variables = (String[]) getCompleteUsefulVariableSet(grammar)
				.toArray(new String[0]);
		for (int k = 0; k < variables.length; k++) {
			String v1 = variables[k];
			for (int i = 0; i < variables.length; i++) {
				String v2 = variables[i];
				if (i != k && isDependentOn(v1, v2, grammar)) {
					Transition trans = getTransition(v1, v2, graph);
					graph.addTransition(trans);
				}
			}
		}
		return graph;
	}