From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 15 11:33:14 2023 Received: (at 61527) by debbugs.gnu.org; 15 Feb 2023 16:33:15 +0000 Received: from localhost ([127.0.0.1]:33758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSKiY-0001BC-D1 for submit@debbugs.gnu.org; Wed, 15 Feb 2023 11:33:14 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:37845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSKiV-0001Au-Sm for 61527@debbugs.gnu.org; Wed, 15 Feb 2023 11:33:12 -0500 Received: by mail-wr1-f49.google.com with SMTP id m10so10844398wrn.4 for <61527@debbugs.gnu.org>; Wed, 15 Feb 2023 08:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1676478786; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eigV7drV3uP9KCIfVNbWRt/BPX9bTfNIEB8UZZ/0Ilc=; b=jwNTb/MSGL3nKwHujq53zOh4To5JnsbmQOJnG/N8tYs7+6CdCCTEIstBeIcKpM+i95 va2a4eMFTWsgla4yhGKlateITWxEnXpB6hS8X1FHnC/UVo6oxm6LZDcxH5gcob3qek2u w8DYQ/SkZXnUTWlACa87dtuoEeYt0RiXOPEyOqsNv84NLeYnvanXvYm+us7NLb+GFzKo mkKIdOpD+cSA5ra+YZ8d+DQkwmGFKRHHTfT6HckdWMzLLAF6G1MLlrlF43FjUbfdrbN/ Y3n2aEeoyOEVhf3jkvk1wGUt6SD8RYBRpIVeWnLOT81yj18/TrpFJuR7RrliuEcM2S/H 3mug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676478786; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=eigV7drV3uP9KCIfVNbWRt/BPX9bTfNIEB8UZZ/0Ilc=; b=LZKu9LxqHoIE4Ya3BdvCJvMvETnVCuehTJc3HfJWUpmR9Th4Tp9ZxcTYl84HmgZx1+ s9hUCW2SB5oAlSs4YlD1KaHSpN5QWqTgbF+Z9C7bVUG+F1xX912kWWp60lulEfNNctIq Z5EOnwEIbKHaFutb7aL54fgW1I4+VIzv2/0QMNvV9v0VNebmTmUu8alwXBJ/swlnSJOf O6UWjY29jCOTfIWcm9H+y9keYwmx5j62XBs30GClD8V2jSre5A9jh38A6+L51URI+Xy/ SadjSUNCTDcLiE8yVnml8EyIUT/eqWJkcRSqoF01AzinH/+gPPT3l5VsVL5j5GHv9BsW 5bRg== X-Gm-Message-State: AO0yUKXRTbJuk9cACk67KklE+eDbG9d/kpDjMHE5woOD7pUIASu2GTBt jTnWB5/RTAvBhy0P8U8tTJOGB+tV5M4= X-Google-Smtp-Source: AK7set+FicAwITKGBJDhnO3JO4oTh4uexumP4x8V+AjyPHKF6aVFJE6Y9ezQ/46Iw/YxHmQENEc96A== X-Received: by 2002:adf:dd82:0:b0:2c3:d296:7a94 with SMTP id x2-20020adfdd82000000b002c3d2967a94mr1573745wrl.3.1676478785861; Wed, 15 Feb 2023 08:33:05 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id h12-20020adff4cc000000b002be505ab59asm16176885wrp.97.2023.02.15.08.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 08:33:05 -0800 (PST) From: Simon Tournier To: Kyle Andrews , 61527@debbugs.gnu.org Subject: Re: [bug#61527] [PATCH] Add edgelist graph backend In-Reply-To: <875yc3sdfo.fsf@posteo.net> References: <875yc3sdfo.fsf@posteo.net> Date: Wed, 15 Feb 2023 17:32:47 +0100 Message-ID: <86h6vmdh3k.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61527 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Wed, 15 Feb 2023 at 05:21, Kyle Andrews wrote: > Dear Guix, > > I would like to be able to conveniently analyze Guix package > dependencies using general purpose network analysis software such as > igraph. To achieve this, I have added another backend to Guix and which > is exposed via guix graph which spits out a three column table that, > while not technically and edge list, is readily transformed into one > with minimal data munging. You might be interested by [1] where I export all the packages as JSON-like (Python dictionary) and then import with python-networkx. Feel free to report your analyses, I am very interested by such. :-) 1: https://yhetil.org/guix/874ju4qyd4.fsf@gmail.com > +(define (emit-edgelist-prologue name port) > + (display "" port)) Here, I would add the description of the data as header of the CSV-like file. For instance, something: --8<---------------cut here---------------start------------->8--- # type, name-or-edge1, item-or-edge2 # package, name, item # depends, edge1, edge2 --8<---------------cut here---------------end--------------->8--- Well, is this format a standard format for representing graph? From igraph documentation [1], it reads =E2=80=99igraph_read_graph_edgelist= =E2=80=99: This format is simply a series of an even number of non-negative integers separated by whitespace. The integers represent vertex IDs. Placing each edge (i.e. pair of integers) on a separate line is not required, but it is recommended for readability. Edges of directed graphs are assumed to be in "from, to" order. so maybe it could be nice to use this plain list for the edgelist backend. WDYT? 1: https://igraph.org/c/doc/igraph-Foreign.html#igraph_read_graph_edgelist Cheers, simon