Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/fining/examples/gap/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 27.6.2023 mit Größe 831 B image not shown  

Quelle  incgeom_incgraph.g   Sprache: unbekannt

 
# incidence graph of an incidence structure
ps := SymplecticSpace(3,2);
pts := List(Points(ps));;
lines := List(Lines(ps));;
flags := Union(List(pts,x->List(Lines(x),y->FlagOfIncidenceStructure(ps,[x,y]))));;
inc := function(x,y)
if x = y then
    return true;
elif IsFlagOfIncidenceStructure(x) and IsElementOfIncidenceStructure(y) then
    return IsIncident(x,y);
elif IsElementOfIncidenceStructure(x) and IsElementOfIncidenceStructure(y) then
    return false;
elif IsFlagOfIncidenceStructure(x) and IsFlagOfIncidenceStructure(y) then   
    return false;
else 
    return inc(y,x);
fi;
end;
type := function(x)
if IsList(Type(x)) then
    return 2;
else
    return 1;
fi;
end;
els := Union(pts,lines,flags);;
struc := IncidenceStructure(els,inc,type,[1,2]);
gamma := IncidenceGraph(struc);
Diameter(gamma);
Girth(gamma);
quit;

[ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet)  ]