(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
SetAttributes[{EROMake,EROPeek,EROAdjoin}, HoldFirst];


(* ::Input::Initialization:: *)
EROMake[er_,n_Integer]:=er=Table[0,n];


(* ::Input::Initialization:: *)
EROPeek[er_,n_Integer]:= If[er[[n]]==0,n,er[[n]]=EROPeek[er,er[[n]]]];


(* ::Input::Initialization:: *)
EROAdjoin[er_,new_UndirectedEdge]:=EROAdjoin[er,new,Identity];
EROAdjoin[er_,n1_Integer\[UndirectedEdge]n2_Integer,comp_]:=Module[{m1,m2},
m1=EROPeek[er,n1]; m2=EROPeek[er,n2];
Switch[Order[{comp[m1],m1}, {comp[m2],m2}],0, m1,1, er[[m2]]=m1,-1, er[[m1]]=m2] ]



