# Use igraph to trigger functions/models on nodes

**URL:** <https://igraph.discourse.group/t/use-igraph-to-trigger-functions-models-on-nodes/1098>\
**Category:** Usage\
**Tags:** R\
**Created:** [10 February 2022 16:45 UTC](https://igraph.discourse.group/t/use-igraph-to-trigger-functions-models-on-nodes/1098 "2022-02-10T16:45:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesguo](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/jamesguo/32/1080_2.png) [@jamesguo](https://igraph.discourse.group/u/jamesguo)\
**Post date:** [10 February 2022 16:45 UTC](https://igraph.discourse.group/t/use-igraph-to-trigger-functions-models-on-nodes/1098/1 "2022-02-10T16:45:50Z")

</div>

Assumed that we have a small graph including some models/functions (their attributes) as nodes and trigger or triggerToRun relationship as edges. I tried to find ways to run some models/functions on nodes using igraph capabilities

(e.g., query) but did not succeed.

Could you please advise if it is possible by using igraph or point me links?

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [16 February 2022 16:22 UTC](https://igraph.discourse.group/t/use-igraph-to-trigger-functions-models-on-nodes/1098/2 "2022-02-16T16:22:45Z")

</div>

It is not entirely clear what you are asking for. Could you perhaps post an example of what you would like to do?

---

<div class="post-metadata">

**Author:** ![jamesguo](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/jamesguo/32/1080_2.png) [@jamesguo](https://igraph.discourse.group/u/jamesguo)\
**Post date:** [20 February 2022 02:13 UTC](https://igraph.discourse.group/t/use-igraph-to-trigger-functions-models-on-nodes/1098/3 "2022-02-20T02:13:56Z")

</div>

Hey,  
to make things simple, assume we have a small graph gt with 5 vertices and 4 edges:

gt = Graph(n = 4, edges = [[0, 2], [0, 4], [1, 2], [2, 3]], directed = T)

```
                               0 Action ---action 2---> 4 Model 2 (e.g., "run Model 2")
                                       |
                                action 1
                                       |
                              downarrow

```

1 Input ------\> 2 Model x\*x+1 ------\> 3 Output (e.g., 101)  
(e.g., x = 10)

Act 1 = click on action node 0  
Act 2 = hover over action node 0 with cursor

If Click on the action node then run model x\*x + 1 with input x = 10 and the output will display/store on Output node 3  
If hover over action node 0 then “run model 2” will display on Model 2 node.

Please advise me or direct me to possible readings.  
Thank you!
