Pensieve header: A program to compute the Alexander polynomial using matrices coming from the Dehn presentation. Written by Daniel Martchenkov in June 2023.

<<KnotTheory`

AlexanderUsingDehn[K_]:=t|->Module[{XingsByArmpits,bends,faces,p,A,is,poly},
XingsByArmpits=
List@@PD[K]/.x:X[i_,j_,k_,l_]:>
If[PositiveQ[x],(SubPlus[X])[-i,j,k,-l],(SubMinus[X])[-j,k,l,-i]];
bends=Times@@XingsByArmpits/.
_[X][a_,b_,c_,d_]:>(Subscript[p, a,-d])(Subscript[p, b,-a])(Subscript[p, c,-b])(Subscript[p, d,-c]);
faces=bends//.(Subscript[p, x__,y_])(Subscript[p, y_,z__]):>(Subscript[p, x,y,z]);
A=Table[0,Length@XingsByArmpits,Length@faces];
Do[is=Position[faces,#][[1,1]]&/@List@@XingsByArmpits[[j]];
A[[{j},is]]+=If[Head[XingsByArmpits[[j]]]===(SubPlus[X]),
(({{1, -1, t, -t}})),(({{-t, 1, -1, t}}))],
{j,Length@XingsByArmpits}];
poly=A[[All,Delete[Range[Length@faces],{Position[faces,#][[1,1]]}&/@{1,-1}]]]//Det;
(((poly/.t->1)poly)/(t^(Mean[{Exponent[poly,t,Max],Exponent[poly,t,Min]}])))//Apart];

AlexanderUsingDehn[Knot[3,1]][t]

Sum[Alexander[K][t]==AlexanderUsingDehn[K][t], {K, AllKnots[{3,10}]}]