<p dir="ltr">Alpar, thanks for your feedback. Not really, since loops were not added to the graph. Had anyone encountered similar problem ? </p>
<div class="gmail_quote">On Jul 19, 2013 7:58 AM, "Alpar Juttner" <<a href="mailto:alpar@cs.elte.hu">alpar@cs.elte.hu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
By definition, countIncEdges() counts the loop edges twice.<br>
Isn't this the root of the problem?<br>
<br>
Regards,<br>
Alpar<br>
On Thu, 2013-07-18 at 13:29 -0400, Kaiming Li wrote:<br>
> Hi there,<br>
><br>
> I'm constructing an undirected graph (grf, which is a ListGraph obj) via<br>
> an existing structure (allEdges), and I know the number of nodes<br>
> (numNodes) and edges (numConnections):<br>
><br>
><br>
> for ( int idx = 0; idx < numNodes ; ++idx )<br>
> {<br>
> grf.addNode();<br>
> } // end for loop::idx<br>
><br>
><br>
> for ( int idx = 0; idx < numConnections ; ++idx )<br>
> {<br>
> if(allEdges[idx].z > threshold && allEdges[idx].x !=<br>
> allEdges[idx].y) { //remove loops and low prob edge; x,y are node index,<br>
> and z is weight<br>
> ListGraph::Node nv = grf.nodeFromId(allEdges[idx].x);<br>
> ListGraph::Node nu = grf.nodeFromId(allEdges[idx].y);<br>
> ListGraph::Edge eg = grf.addEdge(nu,nv);<br>
> prob[eg] = allEdges[idx].z;<br>
> }<br>
> } // end for loop::idx<br>
><br>
> However, when I call method : countIncEdges(grf, grf.nodeFromId(0)), it<br>
> doen't give me the correct result, which is the degree of the first node.<br>
><br>
> Any comment?<br>
> Thanks,<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Lemon-user mailing list<br>
> <a href="mailto:Lemon-user@lemon.cs.elte.hu">Lemon-user@lemon.cs.elte.hu</a><br>
> <a href="http://lemon.cs.elte.hu/mailman/listinfo/lemon-user" target="_blank">http://lemon.cs.elte.hu/mailman/listinfo/lemon-user</a><br>
><br>
<br>
<br>
</blockquote></div>