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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:49:07+00:00 2026-05-25T17:49:07+00:00

Hello I’ve been trying for couple of days to write a script to generate

  • 0

Hello I’ve been trying for couple of days to write a script to generate a progressive map using PHP.
What I’m trying to achieve but with no success would be something like this:
enter image description here

In short I have a “node” defined as 5,6 on xy ( as an example ) then randomly add a random number of “players” close to the “node”. From here I want to connect the closest “player” to the node while having a list of criteria that will determine to which node the “player” will be connected (how many connections are for that node, what’s the max number of connections etc ).
I haven’t written any code yet because I don’t know exactly where to start or with what should I start since I’m not that great with math only pretty good with PHP.
Andy ideas or advice any help is welcomed.

  • 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-05-25T17:49:08+00:00Added an answer on May 25, 2026 at 5:49 pm

    Well, I think you want to create a topology of the network, having as root the internet provider.

    So, I’m thinking that the best way is to create a graph. The root is the red dot. Than the players attached to it. Than the players attached to the already attached players and so on.

    something like this :

                *
             /  |  \
             O  O   O
           / |  |    |
          O  O  O    O
    

    now. Each node of the graph can have some info associated to it:
    type: player | node
    coordX : 5
    coordY: 6
    etc…

    Displaying the map will just mean that you can walk the tree and draw the elements based on their positions, you can draw lines based on the connections.

    If your topology conains cycles, that is player1 connected to player2 which is connected to player3 ….. player n which is connected to player1, than you need a graph structure.

    If i described correctly your problem, than you should find some articles about tree / graph algorithm, how to parse them, etc.. and should be able to do your job.

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

Sidebar

Related Questions

Hello i been trying to get a tokenizer to work using the boost library
Hello everyone i am trying to format the input number range with php number_format
Hello I'm making RSS reader and I'm using DOM. Now I stuck, trying to
Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework
Hello I am trying to create a stacked barplot using the following code: test
hello I am using ubuntu on android(with chroot) I am trying to execute xev
Hello again stackoverflow! So i build this script: <?php $xmlurl = 'http://api.ipinfodb.com/v2/ip_query.php?key=apikey&ip=127.0.0.100&timezone=false'; $xml =
Hello I'm trying to take backup from mysql command line client. I'm using mysqldump
Hello I'm trying to write some values to my SQL through the C# WinForm
Hello I am compiling a program with make but I get the error of

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.