protected internal virtual TransducerGraph BuildMinimizedFA()
        {
            TransducerGraph minimizedFA   = new TransducerGraph();
            TransducerGraph unminimizedFA = GetUnminimizedFA();

            foreach (TransducerGraph.Arc arc in unminimizedFA.GetArcs())
            {
                ICollection <TransducerGraph.Arc> source = ProjectNode(arc.GetSourceNode());
                ICollection <TransducerGraph.Arc> target = ProjectNode(arc.GetTargetNode());
                try
                {
                    if (minimizedFA.CanAddArc(source, target, arc.GetInput(), arc.GetOutput()))
                    {
                        minimizedFA.AddArc(source, target, arc.GetInput(), arc.GetOutput());
                    }
                }
                catch (Exception)
                {
                }
            }
            //throw new IllegalArgumentException();
            minimizedFA.SetStartNode(ProjectNode(unminimizedFA.GetStartNode()));
            foreach (object o in unminimizedFA.GetEndNodes())
            {
                minimizedFA.SetEndNode(ProjectNode(o));
            }
            return(minimizedFA);
        }