How to determine the source vertex of connected component in graphx - scala

I'm trying to determine the source vertex (root) in each connected component. The Graphx documentation says the connected components algorithm labels each connected component of the graph with the ID of its lowest-numbered vertex.
I would like to retrieve the source vertex, in this case 11. How can I do that?

Related

Graphx :Edit the graph and add the vertex and Edges

I'm new to Graphx and doing some research, where I have to map the property graph model to hadoop. I have successfully created the graph by creating Vertex and edge RDD.Now I want to edit my graph by adding vertex at position X and the add a edge at position X-1 and X+1.
I have read multiple documents which says graphs are immutable, but there is an option of subgraph but according to me it is used only to eliminate certain vertex and edges.
Can some one guide me is there any way to edit the graphs ?

three.js calculate surfaces of stl files

I think i have a difficult problem right here..
I want to able to get the surfaces of f.e. the orange object in this three.js example https://threejs.org/examples/?q=stl#webgl_loader_stl
i want to click with the mouse, find the correct surface, which should then be highlighted, so i make sure this was the surface i want.
(i already implemented raycaster successfully, so thats not an issue)
The intersectObject method returns an array of intersections, each of which has face property. The face contains vertex indices.
For STL files containing multiple solids, each solid is assigned to a different group, and the groups are available in the geometry object that is returned from STLLoader. Each group is defined by a range of vertex indices.
So, I think you can correlate the vertex indices returned from the raycaster with the vertex indices in the geometry groups.

Orientdb - Adding Formula to Vertex (Node)

I am new to Orientdb. I have use case of trying to create a financial model in Orientdb . Is it possible to create a formula field type on a vertex that is based on another linked vertex or vertex and edge value . If not possible i am interested in best practice of how to update Vertex field values based on another vertex .

Undirected edges in orientDB

I am working with orientDB v2.2.10 and I am trying to create edges of class "E" between vertices using the graph editor, my question is can create undirected edges between vertices and if yes how to do it via Java API
You can find documentation about graph Java API here:
http://orientdb.com/docs/last/Graph-Database-Tinkerpop.html

How are links reprenteed in the Graph API in OrientDB?

I am having conceptual difficulties with edges and links in OrientDB.
I have a graph that represents link layer and internet layer in a network. link_layer EXTENDS V nodes correspond to MAC addresses, net_layer EXTENDS V nodes correspond to IP addresses.
A communication relationship between two addresses is represented by an edge class conx EXTENDS E. There will be two separate conx edges that represent the same connection: conx 1 connecting MAC A to MAC B, and conx 2 connecting IP a to IP b that represent the same connection. This will create a graph that is partitioned into two separate subgraphs which do not interact (no MAC to IP edges)
Now I need some way to associate the two graphs together. I would like to connect the edges with a link relationship. Each edge could have a LINKLIST property that identifies all the other edges that this edge is identical to in different layers (say I add the TCP/Application layers later, this would be an n-to-n relationship)
So far so good. How do those links affect the graph? OrientDB documentation says that "With the Graph API, Edges are represented with two links stored on both vertices to handle the bidirectional relationship." If then try to interact with this database from the graph API, can LINK or LINKLIST properties be interpreted as edges? Can you even make a link between an edge and an edge? Ideally, it would not affect graph traversal...I'd like to be able to run graph analysis the link layer usage of my network separately from the internet layer.
Sorry for the broad questions, but I am in general just confused about how and why to use referenced relationships and if using them to connect edges in two otherwise unconnected graphs is valid.
In general, a graph should be designed to best represent your scenario being described.
It is therefore essential to identify the entities that will be represented by the various classes.
Each class will have a relationship with another class, by edge or link.
Usually:
An edge Defines a relationship between two vertices. For example, you define two vertices, Person and Car. You then define an Edge Drives. This edge ties the two vertices together. "Jane" Drives "Ford".
While:
A Linklist is a list of classes associated with another class. A Car class might have a Linklist of parts from the Part class. A car Consists of multiple parts.
The edge / link should never be used to have a relationship with each other eg: edge to edge, and if you have this situation means that the graph has problems
conceptual design.