Michal, because not all family have childrens, the warning is raised. so, test your family to see if it have childrens before  :         if(isset($children[$familyID])):
            foreach ($children[$familyID] as $chi):  # for each child create 2x edge to every parent (cost=1)
                $graph[$par][$chi] = CHILD;
                $graph[$chi][$par] = PARENT;
//            echo " par=$par--chi=$chi ";
            endforeach;
        endif;     Michel