Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9269329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:05:36+00:00 2026-06-18T15:05:36+00:00

I have a netlogo question. I have some graph structures of nodes connected with

  • 0

I have a netlogo question. I have some graph structures of nodes connected with (undirected) links. I need to figure out which is the smallest subgraph within one of these structures. Basically subgraph means which nodes are all connected between each other. So if I have a structure of 5 nodes and node 1 is connected to 2 and 3; node 2 to 3, 1 and 4; and node 3 to 1, 2 and 5 I need to detect the subgraph of nodes 1, 2 and 3 since they’re all interconnected.

Is there an easy way to do this or is it basically not computationally possible?

Edit: I figured out that if I use the netlogo extension nw I can use the nw:maximal-cliques method to calculate what I want. Although now I have another problem. I’m trying to fill up a list of the lists of the cliques this way

let lista-cliques [nw:maximal-cliques] of turtles with [guild = g]

lista-cliques is usually of length two but the first element which should be a list of the turtles of the clique is a list like this

[[[nobody] [nobody] [nobody] [nobody]...etc

with a length of 300 when the graphs made by turtles with guild = g are around 2-8 turtles in length. Is the call to nw:maximal-cliques well made?

Any ideas of what am I doing wrong?

Edit 2: I figured how to fix the length of the list by doing this

let lista-cliques (list ([nw:maximal-cliques] of turtles with [guild = g]))

Now the list is not of 300 nodes but equal to the amount of nodes on the graph with nodes with guild = g.

That means that

length item 1 lista-cliques

is equal to

count turtles with [guild = g]

which is also evidently wrong since I can see graphs with nodes connected to only one or two nodes. I think I’m getting closer but I don’t know why nw:maximal-cliques is not creating a list of the maximal-cliques but a list of all the nodes on the graph.

Any ideas?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:05:37+00:00Added an answer on June 18, 2026 at 3:05 pm

    Your usage of nw:maximal-cliques is not quite correct.

    I think that what you are trying to express by specifying of turtles with [guild = g] is something like “taking into account only the turtles that are part of guild g“, but what it actually means to NetLogo is “run the reporter that precedes of for each turtle that are part of guild g and make a list out of that”. (Just like, e.g., [color] of turtles will run the [color] reporter block once for each turtle and build a list of colors with the results.)

    nw:maximal-cliques is a primitive that operates on the whole network, so you don’t want to run it once for each turtle. And just like most primitives in the nw extension, you need to tell it which turtles and links to operate on by using the nw:set-snapshot primitive.

    I think you can achieve what you want by simply doing:

    nw:set-snapshot (turtles with [guild = g]) links
    let lista-cliques nw:maximal-cliques
    

    (Note that nw:set-snapshot takes a static “picture” of your network on which further calls to nw primitives operate. If something changes in your network, you need to call nw:set-snapshot to take a new picture. This will probably change in a future version of the extension.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have been trying to figure this problem out for a while now and was
Have a TSQL view, which I need to group by one column, however, am
Have a linking (or ref) table which has a dual primary key. Need to
Have been trying to figure this out for an hour - and still have
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have got a method which returns IEnumerable<User> which I have been using Linq /
have defined a Java Interface with the annotation @WebService Compiled the code which went
have numerous tests working, but my actual test of some objects is failing and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.