code: public List<int[]> getPaths(int index)
      {
          assert (index <= N && index >= 0);
  
          Stack<PathNode> stack = new Stack<PathNode>();
          int curNode = vertexCount - 1, curIndex = index;
          QueueElement element;
          PathNode node;
          int[] aPath;
          List<int[]> result = new ArrayList<int[]>();
  
          element = fromArray[curNode - 1][curIndex].GetFirst();
          while (element != null)
          {
              // ---------- 通过压栈得到路径 -----------
              stack.push(new PathNode(curNode, curIndex));
              stack.push(new PathNode(element.from, element.index));
              curNode = element.from;
  
              while (curNode != 0)
              {
                  element = fromArray[element.from - 1][element.index].GetFirst();
  //                System.out.println(element.from + " " + element.index);
                  stack.push(new PathNode(element.from, element.index));
                  curNode = element.from;
              }
  
              // -------------- 输出路径 --------------
              PathNode[] nArray = new PathNode[stack.size()];
              for (int i = 0; i < stack.size(); ++i)
              {
                  nArray[i] = stack.get(stack.size() - i - 1);
              }
              aPath = new int[nArray.length];
  
              for (int i = 0; i < aPath.length; i++)
                  aPath[i] = nArray[i].from;
  
              result.add(aPath);
  
              // -------------- 出栈以检查是否还有其它路径 --------------
              do
              {
                  node = stack.pop();
                  curNode = node.from;
                  curIndex = node.index;
  
              } while (curNode < 1 || (stack.size() != 0 && !fromArray[curNode - 1][curIndex].CanGetNext()));
  
              element = fromArray[curNode - 1][curIndex].GetNext();
          }
  
          return result;
      }
docs: 获取前index+1短的路径
  @param index index ＝ 0 : 最短的路径； index = 1 ： 次短的路径, 依此类推。index <= this.N
  @return