I want to use a graph structure in python and translate it to clingo and I have a perfectly good idea on how to to establish the edges and the nodes, partly thanks to this post: How to tell if a graph is strongly connected using answer set programming?
My biggest problem now is that the python data structure that I´m using for the nodes has an optional value and I don't know how to implement that in clingo. It's something of this sort:
Node:
- type: string
- value: optional<string>
What this means is that some nodes will have this property and others won't.
Which in clingo would be something like node(id, type, (optional) string)
and the edges just simply edge(X,Y)
with edge(X,Y) :- edge(Y,X)
.
I have looked through the guide in search of a way to this and couldn't find anything of the sort. I thought about defining a default value for it that would never be used in any of the rules of the program but it doesn't seem like the best policy.
If anyone has any ideas on how to tackle this problem I would greatly appreaciate it.