program[s_String]:= Module[{adj,m,dd,skalazott,ddd,cc},
SetDirectory[NotebookDirectory[]];
adj=Import[s,"AdjacencyMatrix"];
m=(adj/(Total[adj,2]));
dd=DiagonalMatrix[1/(Sqrt[m.ConstantArray[1.,Import[s,"VertexCount"]]])];
MatrixForm[skalazott=dd.m.dd];
Column[{dd. Eigenvectors[skalazott][[1]],dd.Eigenvectors[skalazott][[2]]}];
ddd=dd.Eigenvectors[skalazott][[2]];
cc=ClusteringComponents[ddd,2];
GraphPlot[AdjacencyGraph[adj],VertexRenderingFunction->({If[cc[[#2]]==1,Red,Blue],EdgeForm[Black],Disk[#,.15]}&),ImageSize->800]]

program["karate.gml"]

program["dolphins.gml"]