Details for 2640_Stratum_Compactness_Maplet.mw

Download file: 2640_Stratum_Compactness_Maplet.mw (View Live Worksheet on MapleNet)
Uploaded by Tolga Guyer (3) (View other files uploaded by Tolga Guyer )

The HTML version of this file is shown below. To use the contents of this file in a posting, click here to get the source code


Stratum & Compactness Maplet

by Tolga G\274yer, Gazi University, 06500 Teknikokullar, Ankara, Turkey, guyer@gazi.edu.tr © 2007


This maplet allows the user to compute the two useful measures for the hyperdocuments: Stratum and Compactness. These concepts arose from the modelling studies of the hyperdocument (or Web, in general) and user navigation based on the graph theory. It will also draw the graph and display the adjacency and distance matrices.

Enter a directed graph in the relevant text field in Maple format, such as: graph(1,2,3,4,5,[1,3],[2,3],[3,1],[1,4],[4,1],[2,4]), or one of Maple's built-in graphs, such as complete(8), cube(2), etc. The Adjacency Matrix is generated using the 'adjacency' routine of the networks package and the Distance Matrix is generated using the 'allpairs' routine of the same package.

For further information about the hyperdocument and navigation metrics and measures, please refer to:

Botafogo, R., Rivlin, E. & Shneiderman, B. (1992). Structural analysis of hypertexts: Identifying hierarchies and useful metrics. ACM Trans.Information Systems, 10 (2), 142\342\200\223180.

Harary, F. (1959). Status and contrastatus. Sociometry, 22, 23-43.

Herder, E. (2002). Metrics for the Adaptation of Site Structure. Proc. of the German Workshop on Adaptivity and User Modeling in Interactive Systems, ABIS02 Hannover, 22\342\200\22326.


Herder, E. (2003). Modeling User Navigation. User Modeling 2003, Proc. of the 9th Intl. Conference. Springer LNAI 2702, 417\342\200\223419.

Herder, E. and Van Dijk, B. (2003). From Browsing Behavior to Usability Matters. Proc. of Workshop on Human Information Processing and Web Navigation, HCI 2003, Crete.


McEneaney, J. E. (2001). Graphic and numerical methods to assess navigation in hypertext. Intl. Journal of Human-Computer Studies 55, 761\342\200\223786.

> restart;

> with(Maplets[Elements]):
with(networks):

> ProcDistanceMatrix := proc(H)
description "..Computes the DISTANCE MATRIX of a Graph in NxN matrix form..\
by Tolga GUYER (C)2007";
local T,Dist,N,i,j;
T := allpairs(H):
N := nops(vertices(H)):
Dist:=[]:
for i from 1 to N do
for j from 1 to N do
Dist:=[op(Dist),T[i,j]]:
end do:
end do:
return([linalg[matrix](N,N,Dist)]);
end proc:

> AnalyseG := proc(H)
description "..Computes the COMPACTNESS and STRATUM values of a Graph..\
by Tolga GUYER (C)2007";
global summation;
local i,j,MatrixSum,T,DistN,Dist0,N,Add_DistanceN,Add_Distance0,
Converted_Distance_MatrixN,Converted_Distance_Matrix0,
Dmax,Dmin,Compactness,Stratum;
MatrixSum := proc (M::matrix)
summation := 0:
for i from 1 to linalg[coldim](M) do
for j from 1 to linalg[rowdim](M) do
summation := summation + M[i,j];
end do;
end do;
end:
T := allpairs(H):
DistN:=[]: Dist0:=[]:
N:=nops(vertices(H)):
for i from 1 to N do
for j from 1 to N do
if T[i,j]=infinity then
Add_DistanceN := N:
Add_Distance0 := 0:
else
Add_DistanceN := T[i,j]:
Add_Distance0 := T[i,j]:
end if;
DistN:=[op(DistN),Add_DistanceN]:
Dist0:=[op(Dist0),Add_Distance0]:
end do:
end do:
Converted_Distance_MatrixN:=linalg[matrix](N,N,DistN):
Converted_Distance_Matrix0:=linalg[matrix](N,N,Dist0):
Dmax := N*(N^2-N): Dmin := N^2-N:
Compactness := evalf((Dmax-MatrixSum(Converted_Distance_MatrixN))/(Dmax-Dmin));
summation := 0:
for i from 1 to N do
summation := summation +
abs(sum(Converted_Distance_Matrix0[k,i],k=1..N)-
sum(Converted_Distance_Matrix0[i,k],k=1..N));
end do:
Stratum := evalf(`if`(type(N,even),4*summation/N^3,4*summation/(N^3-N)));
return([Stratum,Compactness]);
end proc:

> ProcStratum := proc(H)
return(AnalyseG(H)[1]);
end proc:

> ProcCompactness := proc(H)
return(AnalyseG(H)[2]);
end proc:

> maplet := Maplet(Window('title'="Stratum & Compactness Maplet",
BoxColumn('vscroll'='always',
BoxRow(Button("Clear Fields", Action(SetOption('TF1' = ""), Evaluate( 'PL1'= ""), SetOption('ML1'=""), SetOption('TFSt'=""), SetOption('TFCp'=""))),
Button("Help", onclick=RunWindow('Help')),
Button("About", onclick=RunWindow('About')),
Button("Close", Shutdown(['TF1']))),
BoxColumn(["Enter a graph :", TextField['TF1'](80,
value="graph(1,2,3,4,5,6,[1,2],[2,1],[2,3],[3,2],[2,4],[4,2],[3,5],[5,3],[3,6],[6,3],[5,6],[6,5],[6,1],[4,4])")]),
BoxColumn([Button("DRAW GRAPH", Evaluate('PL1'='draw(TF1)')),
Button("COMPUTE", Action(Evaluate('TFSt'='ProcStratum(TF1)'),
Evaluate('TFCp'='ProcCompactness(TF1)') )),
Button("ADJACENCY MATRIX", Evaluate('ML1'='[adjacency(TF1)]')), Button("DISTANCE MATRIX", Evaluate('ML1'='ProcDistanceMatrix(TF1)'))]),
BoxRow(Plotter['PL1'](height=350, width=350, background="#FFFFDF"),
MathMLViewer['ML1']('value' = MathML[Export](" "), height=350, width=350,
background="#FFFFDF", wrapped = true)),
BoxRow(["STRATUM:", TextField['TFSt'](20, background="#66FFFF", editable=false,
halign=center, font=Font("Helvetica", 16))]),
BoxRow(["COMPACTNESS:", TextField['TFCp'](20, background="#66FFFF", editable=false,
halign=center, font=Font("Helvetica", 16))]))),
Window['About']('title'='About', 'layout'='AboutLayout', height=200, width=350),
BoxLayout['AboutLayout'](BoxRow(Label(
"Created by Tolga Guyer, PhD.

Gazi University, Faculty of Education, 06500, Teknikokullar, Ankara, Turkey
guyer@gazi.edu.tr, tguyer@gmail.com.

This Maplet was developed and tested using Maple V.10"
))),

Window['Help']('title'='Help', 'layout'='HelpLayout', height=600, width=450),
BoxLayout['HelpLayout'](BoxRow(Label(
"This maplet allows the user to compute the two useful measures for the
hyperdocuments: Stratum and Compactness. These concepts arose from the
modelling studies of the hyperdocument (or Web, in general) and user
navigation based on the graph theory. It will also draw the graph and
display the adjacency and distance matrices.

Enter a directed graph in the relevant text field in Maple format, such
as: graph(1,2,3,4,5,[1,3],[2,3],[3,1],[1,4],[4,1],[2,4]), or one of
Maple's built-in graphs, such as complete(8), cube(2), etc. The Adjacency
Matrix is generated using the 'adjacency' routine of the networks package
and the Distance Matrix is generated using the 'allpairs' routine of the
same package.

For further information about the hyperdocument and navigation metrics and
measures, please refer to:

-Botafogo, R., Rivlin, E. & Shneiderman, B. (1992). Structural analysis of
hypertexts: Identifying hierarchies and useful metrics. ACM Trans.
Information Systems, 10 (2), 142\342\200\223180.
-Harary, F. (1959). Status and contrastatus. Sociometry, 22, 23-43.
-Herder, E. (2002). Metrics for the Adaptation of Site Structure. Proc. of
the German Workshop on Adaptivity and User Modeling in Interactive
Systems, ABIS02 Hannover, 22\342\200\22326.
-Herder, E. (2003). Modeling User Navigation. User Modeling 2003, Proc. of
the 9th Intl. Conference. Springer LNAI 2702, 417\342\200\223419.
-Herder, E. and Van Dijk, B. (2003). From Browsing Behavior to Usability
Matters. Proc. of Workshop on Human Information Processing and Web
Navigation, HCI 2003, Crete.
-McEneaney, J. E. (2001). Graphic and numerical methods to assess
navigation in hypertext. Intl. Journal of Human-Computer Studies 55,
761\342\200\223786.
")))):

> Maplets[Display](maplet);

Maple Equation

>

This post was generated using the MaplePrimes File Manager

View 2640_Stratum_Compactness_Maplet.mw on MapleNet or Download 2640_Stratum_Compactness_Maplet.mw
View file details


HTML Source Code

Copy this code into any posting to insert this file into a posting on MaplePrimes

IMPORTANT INFORMATION

When pasting this code into a post on MaplePrimes, make sure that you choose the Worksheet HTML input format

Download Link Code

Copy this code into any posting to share this file with other users

}