Sponsored Content
Top Forums Shell Programming and Scripting Making Connection nodes for Graph Post 302319957 by colemar on Tuesday 26th of May 2009 04:13:57 PM
Old 05-26-2009
Also doing even the join work in awk:
Code:
nawk '
NR==FNR { c = a[$1]; a[$1] = c?c" "$2:$2; next }
{ c = a[$1]
  if (c) {
    split(c,b)
    for (k in b) {
      p = $2<b[k]?$2" "$1" "b[k]:b[k]" "$1" "$2
      if (!d[p]++) print p
    }
  }
}
' file1 file1

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i-nodes

first off, i am new to unix so please bear with me. i was reading somewhere that if your i-nodes get critical that it can slow your network down. what are i-nodes and when do they become a critical number? this is what mine states: / (/dev/root ): 777058 blocks 569290 i-nodes... (4 Replies)
Discussion started by: djatwork
4 Replies

2. UNIX for Dummies Questions & Answers

nodes

how do you list all the nodes in unix :confused: (3 Replies)
Discussion started by: kamisi
3 Replies

3. UNIX for Advanced & Expert Users

Managing nodes???

Does anyone know something about this? I have no idea what it means and how to do it. but if anyone can give me and explanation and also point me to a website, i'd really appreciate it (5 Replies)
Discussion started by: TRUEST
5 Replies

4. Shell Programming and Scripting

Making Large Connection nodes for Graph

Hi power user, Basically, this thread is a continuation of the previous one :): https://www.unix.com/shell-programming-scripting/110650-making-connection-nodes-graph.html#post302326483 However, I'm going to explain it again. I have this following data: file1 aa A ... (3 Replies)
Discussion started by: anjas
3 Replies

5. UNIX for Advanced & Expert Users

Connection reset by peer..closing connection

Hello I'm facing the above problem while doing a performance run. I've a script which I'm launching from my windows desktop using mozilla. The script will invoke backend action on a Solaris host which in turn feeds the records to a driver located on a linux box(Cent OS). What's happening is... (1 Reply)
Discussion started by: subramanyab
1 Replies

6. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

7. High Performance Computing

request more nodes

I am new to cluster commands. But I have tried utilizing: -pe, but I do not know my parallel computing environment. We are running SGE, is there a simpler command to request more nodes? also: qsub -N auto -M name@email.com -m abe auto.sh does not email me at all. Help would be appreciated (0 Replies)
Discussion started by: theawknewbie
0 Replies

8. UNIX for Dummies Questions & Answers

One service, two nodes, HA

Hi all. I have two nodes taken different places. They are connected together on a network. So, i have a service, it works on one of nodes and when the node is unavailable the service should will be launched on other node. Solution: rhel cluster, keepalive, hearbeat...may be Carp but what if... (2 Replies)
Discussion started by: Flomaster
2 Replies

9. Shell Programming and Scripting

Remove duplicate nodes

Hi all, I have a list of node pairs separated with a comma and also, associated with their respective values. For example: b0015,b1224 1.1 b0015,b2576 1.4 b0015,b3162 2.5 b0528,b1086 1.7 b0528,b1269 5.4 b0528,b3602 2.1 b0948,b2581 3.2 b1224,b0015 1.1... (8 Replies)
Discussion started by: AshwaniSharma09
8 Replies

10. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies
Graph::Easy::Group(3pm) 				User Contributed Perl Documentation				   Graph::Easy::Group(3pm)

NAME
Graph::Easy::Group - A group of nodes (aka subgraph) in Graph::Easy SYNOPSIS
use Graph::Easy; my $bonn = Graph::Easy::Node->new('Bonn'); $bonn->set_attribute('border', 'solid 1px black'); my $berlin = Graph::Easy::Node->new( name => 'Berlin' ); my $cities = Graph::Easy::Group->new( name => 'Cities', ); $cities->set_attribute('border', 'dashed 1px blue'); $cities->add_nodes ($bonn); # $bonn will be ONCE in the group $cities->add_nodes ($bonn, $berlin); DESCRIPTION
A "Graph::Easy::Group" represents a group of nodes in an "Graph::Easy" object. These nodes are grouped together on output. METHODS
new() my $group = Graph::Easy::Group->new( $options ); Create a new, empty group. $options are the possible options, see Graph::Easy::Node for a list. error() $last_error = $group->error(); $group->error($error); # set new messags $group->error(''); # clear error Returns the last error message, or '' for no error. as_ascii() my $ascii = $group->as_ascii(); Return the group as a little box drawn in ASCII art as a string. name() my $name = $group->name(); Return the name of the group. id() my $id = $group->id(); Returns the group's unique ID number. set_attribute() $group->set_attribute('border-style', 'none'); Sets the specified attribute of this (and only this!) group to the specified value. add_member() $group->add_member($node); $group->add_member($group); Add the specified object to this group and returns this member. If the passed argument is a scalar, will treat it as a node name. Note that each object can only be a member of one group at a time. add_node() $group->add_node($node); Add the specified node to this group and returns this node. Note that each object can only be a member of one group at a time. add_edge(), add_edge_once() $group->add_edge($edge); # Graph::Easy::Edge $group->add_edge($from, $to); # Graph::Easy::Node or # Graph::Easy::Group $group->add_edge('From', 'To'); # Scalars If passed an Graph::Easy::Edge object, moves the nodes involved in this edge to the group. if passed two nodes, adds these nodes to the graph (unless they already exist) and adds an edge between these two nodes. See add_edge_once() to avoid creating multiple edges. This method works only on groups that are part of a graph. Note that each object can only be a member of one group at a time, and edges are automatically a member of a group if and only if both the target and the destination node are a member of the same group. add_group() my $inner = $group->add_group('Group name'); my $nested = $group->add_group($group); Add a group as subgroup to this group and returns this group. del_member() $group->del_member($node); $group->del_member($group); Delete the specified object from this group. del_node() $group->del_node($node); Delete the specified node from this group. del_edge() $group->del_edge($edge); Delete the specified edge from this group. add_nodes() $group->add_nodes($node, $node2, ... ); Add all the specified nodes to this group and returns them as a list. nodes() my @nodes = $group->nodes(); Returns a list of all node objects that belong to this group. edges() my @edges = $group->edges(); Returns a list of all edge objects that lead to or from this group. Note: This does not return edges between nodes that are inside the group, for this see edges_within(). edges_within() my @edges_within = $group->edges_within(); Returns a list of all edge objects that are inside this group, in arbitrary order. Edges are automatically considered inside a group if their starting and ending node both are in the same group. Note: This does not return edges between this group and other groups, nor edges between this group and nodes outside this group, for this see edges(). groups() my @groups = $group->groups(); Returns the contained groups of this group as Graph::Easy::Group objects, in arbitrary order. groups_within() # equivalent to $group->groups(): my @groups = $group->groups_within(); # all my @toplevel_groups = $group->groups_within(0); # level 0 only Return the groups that are inside this group, up to the specified level, in arbitrary order. The default level is -1, indicating no bounds and thus all contained groups are returned. A level of 0 means only the direct children, and hence only the toplevel groups will be returned. A level 1 means the toplevel groups and their toplevel children, and so on. as_txt() my $txt = $group->as_txt(); Returns the group as Graph::Easy textual description. _find_label_cell() $group->_find_label_cell(); Called by the layouter once for each group. Goes through all cells of this group and finds one where to attach the label to. Internal usage only. get_attributes() my $att = $object->get_attributes(); Return all effective attributes on this object (graph/node/group/edge) as an anonymous hash ref. This respects inheritance and default values. See also raw_attributes(). raw_attributes() my $att = $object->get_attributes(); Return all set attributes on this object (graph/node/group/edge) as an anonymous hash ref. This respects inheritance, but does not include default values for unset attributes. See also get_attributes(). attribute related methods You can call all the various attribute related methods like "set_attribute()", "get_attribute()", etc. on a group, too. For example: $group->set_attribute('label', 'by train'); my $attr = $group->get_attributes(); You can find more documentation in Graph::Easy. layout() This routine should not be called on groups, it only works on the graph itself. shape() my $shape = $group->shape(); Returns the shape of the group as string. has_as_successor() if ($group->has_as_successor($other)) { ... } Returns true if $other (a node or group) is a successor of this group, e.g. if there is an edge leading from this group to $other. has_as_predecessor() if ($group->has_as_predecessor($other)) { ... } Returns true if the group has $other (a group or node) as predecessor, that is if there is an edge leading from $other to this group. root_node() my $root = $group->root_node(); Return the root node as Graph::Easy::Node object, if it was set with the 'root' attribute. EXPORT
None by default. SEE ALSO
Graph::Easy, Graph::Easy::Node, Graph::Easy::Manual. AUTHOR
Copyright (C) 2004 - 2008 by Tels <http://bloodgate.com> See the LICENSE file for more details. perl v5.14.2 2011-12-23 Graph::Easy::Group(3pm)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy