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 8090807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:50:36+00:00 2026-06-05T19:50:36+00:00

Problem background I am currently developing a framework of Ant Colony System algorithms. I

  • 0

Problem background

I am currently developing a framework of Ant Colony System algorithms. I thought I’d start out by trying them on the first problem they were applied to: Travelling Salesman Problem (TSP). I will be using C# for the task.

All TSP instances will consist of a complete undirected graph with 2 different weights associated with each edge.

Question

Until now I’ve only used adjacency-list representations but I’ve read that they are recommended only for sparse graphs. As I am not the most knowledgeable of persons when it comes to data structures I was wondering what would be the most efficient way to implement an undirected complete graph?

I can provide additional details if required.

Thank you for your time.

UPDATE

Weight clarification. Each edge will have the two values associated with them:

  1. distance between two cities ( d(i,j) = d(j,i) same distance in both directions)
  2. amount of pheromone deposited by ants on that particular edge

Operations. Small summary of the operations I will be doing on the graph:

  • for each node, the ant on that particular node will have to iterate through the values associated with all incident edges

Problem clarification

Ant Colony Optimization algorithms can “solve” TSP as this is where they were first applied to . I say “solve” because they are part of a family of algorithms called metaheuristics optimizations, thus they never guarantee to return the optimal solution.

Regarding the problem at hand:

  • ants will know how to complete a tour because each ant will have a memory.
  • each time an ant visits a city it will store that city in its memory.
  • each time an ant considers visiting a new city it will search in its memory and pick an outgoing edge only if that edge will not lead it to an already visited city.
  • when there are no more edges the ant can choose it has complete a tour; at this point we can retrace the tour created by the ant by backtracking through its memory.

Research article details: Ant Colony System article

Efficiency considerations

I am more worried about run time (speed) than memory.

  • 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-05T19:50:39+00:00Added an answer on June 5, 2026 at 7:50 pm

    First, there’s a general guide to adjacency lists vs matrices here. That’s a pretty low-level, non-specific discussion, though, so it might not tell you anything you don’t already know.

    The takeaway, I think, is this: If you often find yourself needing to answer the question, “I need to know the distance or the pheromone level of the edge between exactly node i and node j,” then you probably want the matrix form, as that question can be answered in O(1) time.

    You do mention needing to iterate over the edges adjacent to a node– here is where some cleverness and subtlety may come in. If you don’t care about the order of the iteration, then you don’t care about the data structure. If you care deeply about the order, and you know the order up front, and it never changes, you can probably code this directly into an adjacency list. If you find yourself always wanting, e.g., the largest or smallest concentration of pheromones, you may want to try something even more structured, like a priority queue. It really depends on what kind of operations you’re doing.

    Finally, I know you mention that you’re more interested in speed than memory, but it’s not clear to me how many graph representations you’ll be using. If only one, then you truly don’t care. But, if each ant is building up its own representation of the graph as it goes along, you might care more than you think, and the adjacency list will let you carry around incomplete graph representations; the flip side of that is that it will take time to build the representations up when the ant is exploring on its frontier.

    Finally finally, I know you say you’re dealing with complete graphs and TSP, but it is worth thinking about whether you will ever need to adapt these routines to some other problem on possibly graphs, and if so, what then.

    I lean toward adjacency lists and/or even more structure, but I don’t think you will find a clean, crisp answer.

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

Sidebar

Related Questions

I am currently developing a new website and have problems with IE7. First image
Problem Background I am currently working on a camel based ETL application that processes
I currently have background music playing in my application. in: -(void)viewDidLoad I start the
Some background. I am currently working on a distributed system in Java. The code
I am currently trying to design a website template for me, the problem is
Having a background in Haskell I am currently trying to get familiar with Scala.
I'm trying to save a setting that keeps what background image I'm currently using.
Background: We're modeling the firmware for a new embedded system. Currently the firmware is
A little background first. I'm developing an application for corporate devices running on the
I want to fix the Background while only the ListFields scrolls. Current Problem: Scrolling

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.