Questions tagged [nodes]

Nodes are the basic units used to build data structures such as linked lists and trees.

A node is a record consisting of one or more fields that are links to other nodes, and a data field. The link and data fields are often implemented by pointers or references although it is also quite common for the data to be embedded directly in the node.

Nodes are used to build linked data structures such as , , and . Large and complex data structures can be formed from groups of interlinked nodes. Nodes are conceptually similar to vertices, which are elements of a graph. Software is said to have a node graph architecture when its organization consists of interlinked nodes.

http://en.wikipedia.org/wiki/Node_(computer_science)

6243 questions
11
votes
1 answer

looping through nodes and extract attributes in Networkx

I defined in python some shapes with corresponding corner points, like this: square = [[251, 184], [22, 192], [41, 350], [244, 346]] triangle = [[250, 181], [133, 43], [21, 188]] pentagon =…
Francesco Sgaramella
  • 1,009
  • 5
  • 21
  • 39
11
votes
2 answers

Get all child, grandchild etc nodes under parent using php with mysql query results

I've been trying to figure this out but I haven't gotten anywhere.Hopefully someone can come to my rescue. My problem is I'm using adjacency list data model to produce my hierarchy data in mysql.I can retrieve the table (see below) into a…
Benny33
  • 475
  • 1
  • 6
  • 12
10
votes
4 answers

Arbor Js - Node Onclick?

I'm using arbor.js to create a graph. How do I create an onclick event for a node, or make a node link somewhere upon being clicked? The Arborjs.org homepage has nodes which link to external pages upon being clicked, how do I replicate this, or make…
Eric Bernd
  • 115
  • 1
  • 1
  • 7
10
votes
2 answers

Undirected graph conversion to tree

Given an undirected graph in which each node has a Cartesian coordinate in space that has the general shape of a tree, is there an algorithm to convert the graph into a tree, and find the appropriate root node? Note that our definition of a "tree"…
paniwani
  • 659
  • 3
  • 9
  • 18
10
votes
7 answers

const utf8Encoder = new TextEncoder(); in Node js

I am trying to use mongodb so I install mongoose package but the problem is when I am writing like this const express = require("express"); const dotenv = require("dotenv"); const mongoose = require("mongoose"); //getting error here It showing me…
user16041868
10
votes
3 answers

Mix CommonJS and ES6 modules in same project

I am working in NodeJS. I have a great deal of legacy code including several packages that are used in many places. This code is all CommonJS, Node require() module structures. Node now supports ES6. Since it is a Javascript language feature, I…
tqwhite
  • 658
  • 7
  • 16
10
votes
1 answer

AWS multiple Lambda in same project

My team is in the process of creating a project which follows the serverless architecture, we are using AWS Lambda, NodeJS, and Serverless framework. The application will be a set of services each one will be handled as a separate function. I found…
emad omara
  • 498
  • 2
  • 5
  • 16
10
votes
1 answer

Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset is larger than the node's length

The following code is often throwing an error that reads Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset some integer is larger than the node's length (some smaller integer). var range =…
Glen Pierce
  • 4,401
  • 5
  • 31
  • 50
10
votes
7 answers

Xml node reading for each loop

I am trying to loop through an Xml file and display the value for account in a message. XmlNodeList nodeList = testDoc.SelectNodes("/details/row/var"); foreach (XmlNode no in nodeList) { XmlNode node =…
Ebikeneser
  • 2,582
  • 13
  • 57
  • 111
10
votes
3 answers

How to extract random nodes from networkx graph?

How to extract random nodes from networkx graph? I have a map in the form of a networkx graph and I have to extract 5 random nodes from it and get the data associated to each of them and their edges. I suppose I can do that with "np.random.choice"…
Lora Kostova
  • 113
  • 1
  • 1
  • 5
10
votes
1 answer

Node graph layout library for incremental graphs

I'm looking for a library to which nodes and edges can be supplied and which generates a coordinate list of all the nodes laid out nicely. However, it should be possible to supply fixed positions for some, but not all nodes which the layout…
sudoremo
  • 2,274
  • 2
  • 22
  • 39
10
votes
2 answers

Very fast algorithm for all paths between two nodes

I am very new to python coding and I am looking for an algorithm that would quickly find all of the paths between a start node and end node for a very large graph - say a graph that has approx 1000 nodes and 10,000 edges. The number of paths that…
Garen Pledge
  • 113
  • 1
  • 6
10
votes
3 answers

Iterate through binary search tree to find all leaves

I am pretty new to trees, and I am trying to create kind of a "leaf iterator". I'm thinking it should put all nodes that does not have a .left and .right value onto a stack, but I'm not sure how or even if it's the right thing to do. I have tried…
Sti
  • 8,275
  • 9
  • 62
  • 124
9
votes
4 answers

nvm use fails in windows with a user name containing space

My issue is related to this problem from 3 years ago. nvm-windows fails when the user path contains a space However, none of these solution help me. My user folder name is Sunita Dahal. I successfully installed nvm, I can use nvm install as well as…
rakesh shrestha
  • 1,335
  • 19
  • 37
9
votes
2 answers

How to get the content of an XML node using XPath and Nokogiri

I have code like this: @doc = Nokogiri::HTML(open(url) @doc.xpath(query).each do |html| puts html # how get content of a node end How do I get the content of the node instead of something like this:
  • John
    • 1,350
    • 5
    • 27
    • 49