[Lemon-user] New User - Simple Questions
Kovács Péter
kpeter at inf.elte.hu
Tue Aug 7 23:03:41 CEST 2012
Hi Jynks,
I suggest you to have a look at the LEMON tutorial:
http://lemon.cs.elte.hu/pub/tutorial/
Particularly, Section 3 introduces the basic concepts and shows code
snippets for building and traversing a directed graph as well as for the
usage of node/arc maps.
Regards,
Peter
On 2012.08.07. 22:35, Jyujinkai Shikmia wrote:
> Ok .. so there is addArc() (i thought this was something else)
>
> g.addArc(); ... so in my example..
>
> A B C
> A 0 1 0
> B 1 0 5
> C 0 0 0
>
>
> g.addArc(A,B);
> g.addArc(B,A);
> g.addArc(B,C);
>
> This is adding connection info that A connects to B and B connects to A
> and C and C connects to nothing.
>
> I am still unsure how to add weight though.... to store distance.. so I
> can then use the shortest path stuff.
>
> On 8/08/2012 6:07 AM, Jyujinkai Shikmia wrote:
>> HI there...
>>
>> I am a hobby programmer and not the most experienced. I have been
>> looking at Lemon to drive the path finding for a hobby game project I
>> am using, but I am confused at how to enter my map data.
>>
>> My understanding of a "directed" graph is that you have a node, and it
>> can link or not link to another node and then you have a weight on it...
>>
>> Example...
>>
>> A B C
>> A 0 1 0
>> B 1 0 5
>> C 0 0 0
>>
>> In this... A is connected to B with a weight of 1, C is connected to
>> nothing.. so once you get to C you are stuck, and B connects to A wit
>> ha value of 1 and B connects to C with a value of 5....
>>
>> The tutorial say to do something like this...
>>
>> ListDigraph g;
>> ListDigraph::Node A = g.addNode();
>> ListDigraph::Node B = g.addNode();
>> ListDigraph::Node C = g.addNode();
>>
>> So now I have a graph "g" with the three nodes... so um... now what?
>> Where / How do I add the connectivity information as well as the
>> weight values...
>>
>> Thanks in advance!
>> --Jynks
>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>
More information about the Lemon-user
mailing list